Possible Duplicate:
what is the difference between (.) dot operator and (->) arrow in c++
in this book i have I’m learning pointers, and i just got done with the chapter about OOP (spits on ground) anyways its telling me i can use a member selection operator like this ( -> ). it sayd that is is like the “.” except points to objects rather than member objects. whats the difference, it looks like it is used the same way…
Yeah, it actually does the same thing but for different kind of variables.
If you have a pointer you have to use
->, while if you have a real value you will use..So for example
That’s not hard at all. Just remember that with a pointer you will need
->, and.otherwise.