i just have a question are this the same if not why or why not.
Code:x.y // member y of object by x
x->y menber y of object by x but am i passing by reference right?
Printable View
i just have a question are this the same if not why or why not.
Code:x.y // member y of object by x
x->y menber y of object by x but am i passing by reference right?
No, x->y is equivalent to (*x).y, i.e., member y of object pointed to by x.
When you use x.y, x is an object instance, but in the case x->y then x is a pointer to an object you have created and you are accessing member y through the pointer to that object rather than through the object instance itself.
x->y is the same as (*x).y
and
x.y is the same as (&x)->y
Edit: Laserlight is quick off the button when it comes to answering questions, lol. :p