0
What is the difference between . and -> ??
For example A.Func() and A->Func()
2 Answers
+ 3
if you have direct access to the object then use dot operator
and if you are accessing the object by pointer then use ->
eg:
A a; a.methods();
A* pa=&a; pa->methods();
+ 1
The dot represents a member of an object, the arrow represents a member of a pointer to an object.