Jump to content
Tuts 4 You

What is its purpose?


X-88

Recommended Posts

Posted

1. Delphi (.), C++ (->). why there is also a sign(.) in C++, the purpose of his(.) what?

2. what do you mean e.g : 0x4f, the multiplication 0 * 4f?.

3. what is the meaning(::), (=+ or =-) in C++? if at Delphi as what? is there an E-Book to all my questions?... help me please! thx b4!.

Posted

There are literally thousands of ebooks about C++, picky any of them and they will answer your questions.

Posted

Now i just have trouble on it, else i think a lot of similiarities with Delphi, but C++ is too sensitive. and i also have e-book but discuss further just makes application, not basic command C++.

Posted
1. Delphi (.), C++ (->). why there is also a sign(.) in C++, the purpose of his(.) what?

In C++ you have both operators.

The (.) 'dot' operator means to direct access an objects member(s).

The (->) 'arrow' operator is to deference the pointer of the object to its members.

For example:

    struct user_entry {
char username[255];
char password[255];
bool isAdmin;
}; // (.) 'dot' operator example
user_entry user;
strcpy( user.username, "Admin" );
strcpy( user.password, "test1" );
user.isAdmin = true; // (->) 'arrow' operator example
user_entry* puser = new user_entry; // Notice the pointer!
strcpy( puser->username, "Admin2" );
strcpy( puser->password, "test22" );
puser->isAdmin = false;
delete puser;
2. what do you mean e.g : 0x4f, the multiplication 0 * 4f?

0x means hex. The following number/letter combination is what is treated as hexadecimal. So 0x4F is 79, and so on like:

0x00 = 0

0x01 = 1

0x0F = 15

0x4F = 79

etc.

3. what is the meaning(::), (=+ or =-) in C++? if at Delphi as what? is there an E-Book to all my questions?... help me please! thx b4!.

The (::) 'double-colon' operator is the 'scope resolution operator'. Rather then explain it to you, here's a wiki link for the real definition:
/>http://en.wikipedia.org/wiki/Scope_resolution_operator

As for the other part (=+ or =-) did you mean += and -=? These are increment assignments. They increment the left-hand value by the given right-hand value. For example:

int x = 0;

x += 1;

x would now be 1.

int x = 1;

x -= 1;

x would now be 0.

I recommend you check out these two links for further basic questions:
/>http://www.cplusplus.com/doc/tutorial/
/>http://www.parashift.com/c++-faq/

Parashift is a great FAQ website for most C++ questions.

  • Like 1
Posted

int x = 0;

x += 1;

whether if the Pascal like this ?....

var

i: integer;

begin

i: = i + 1;

end;

Thank you comrade! I mean it's true, I was online using the cellular telephone so I'm not free to retaliate at the time & I did not have time to look for a tutorial, because his internet connection is very bad.

Posted

whether if the Pascal like this ?....

var

i: integer;

begin

i: = i + 1;

end;

Thank you comrade! I mean it's true, I was online using the cellular telephone so I'm not free to retaliate at the time & I did not have time to look for a tutorial, because his internet connection is very bad.

Yes.

x = x + 1; is the same thing as x += 1;

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...