0
. :: ->
When using c++ classes, when do I use the dot(.) double colon (::) and the arrow (->)?
1 ответ
+ 4
The dot is for accessing members of an object.
The double colon is to access a class' member or a namespace's
Finally the arrow is to access an object's member from a pointer.
my_personj.setName("something");
person_ptr->printName();
Person::myMethod();