what does -> mean in a c or c++ program?
what does -> mean in a c or c++ program?
PHI is one 'H' of alot more interesting than PI!
if we have a pointer to struct:
then we can access the contents of the struct this way:Code:struct x { int a; int b; }; struct x *px; ... // code assigns valid address to px. ...
But that's quite awkward to write (it gets even worse if you have a struct with pointers to structs in it).Code:(*px).a = 7; (*px).b = 9;
So the language also has a short form of this:
--Code:px->a = 7; px->b = 9l
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Makes sense. Thanks alot.
PHI is one 'H' of alot more interesting than PI!