View Single Post
  #10  
Old August 8th, 2006, 05:48 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT: Stupid c++

Ah, the joys of dereferencing.

. is used to access members of an object.

-> is used to access members of an object when you have a pointer to that object.

If you have:

object* MyObjectPtr = new object();

then you have to access members via:

MyObjectPtr->member();

Whereas if you have just:

object MyObject;

you use:

MyObject.member();
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote