What does the -> sign mean in c++?

Question:

Or at least what it's called to google about it.

Answer:

Indirect operator.

The meaning is something like this – for example, in a structure / class like

struct T {
    int t;
    ...

you are accessing the field (member) t of the object T obj as

obj.t

If you have a pointer to a T* ptr object, then you access the field of the object pointed to by ptr as

(*ptr).t

or – look carefully 🙂 – how to

ptr->t

Here's exactly what it is…

Scroll to Top