6 AnswersNew Answer
When a pointer points to an object, you have two ways to access its member functions, like @Alex Stoica said: MyClass* object = MyClass(); object->doSomething(); (*object).doSomething(); The only place you use the arrow is for pointers to objects, or for the keyword 'this'.
A pointer is a variable wich contain an adress. An adress is like '0x116f2c'. The adress of a variable is the place where it is in the memory. int a; // classic integer variable int *pa; // pointer on an integer /* '&a' is the adress of 'a' pa=&a; So here, 'pa' is a pointer, a variable. Its value is the adress of the variable 'a'. cout<<pa; will output an adress something like this : 0x3h56g2. You can access to the value of 'a' with 'pa' : *pa==a Conclusion : pa==&a and *pa==a If you don't understand or if you want à code to have an exemple, ask !
Hey Thank you for your help!!
It doesn't really answer, to your first question but if you learnt something in my answer, you couldn't understand '->' operator 😊
You should learn about pointers. a->b and (*a).b are equivalent
I try it, but it's a big problem for me to understand it :/