Use ->
when you have a pointer.
Use .
when you have structure (class).
When you want to point attribute that belongs to structure use .
:
structure.attribute
When you want to point to an attribute that has reference to memory by pointer use ->
:
pointer->method;
or same as:
(*pointer).method