Pointers are one of the most confusing concepts for some people. Not everyone. Just some people. So here is a description of pointers to make sure you get it. It is central to this entire discussion.
You should also know about the & operand which is used to get the address of something. To get the address of i, you would write &i. As in:
int i = 10;
int * p = &i;
now p contains the address of i.
A pointer is a variable that contains an address to memory somewhere on the computer. Let's say i is an integer with a value of 10. That integer lives somewhere in the computer RAM. Lets say it lives at address 5555. If we have a pointer p that points to that integer, then p has a value of 5555.
Great, let's go on.
Let's say there is a structure or class containing an integer i.
so i, is a member of our class. If an instance of that class exists somewhere it has an address. The same address and pointer discussion from before applies. p = 5555, which is the address of the object(instance of class). So we say p points to the object.
This might look like this:
MyClass o = MyClass(); //create object o
MyClass *p = &o; //get the address of o
Now we want to access the member i of that class. I would put p->i to get that value because p is a pointer to the object that contains the member item I want. At any time, you can change p to make it point to some other object.
Member selection using "." is like the original integer discussion using i.
In the original discussion, i was the actual integer. In the same way, if the object is o, then o.i is the member i of object o.
In the example above, p->i is refers to the same value as o.i;