Just as pointers to any standard data type can be created, so can pointers to classes and data structures. In standard cases where pointers are not used, as we have already seen, objects such as Frog can be created and changed as follows:
Frog frog; frog.eat();
However, if dealing with a pointer to Frog, the notation changes somewhat. Instead, the pointer to member operator (->) is used to access class members and methods, as shown in the following code.
Frog frog; Frog *Pointer_To_Frog = &frog; frog->eat();
Every C++ class has a special member pointer called this. (In other languages it is sometimes called me.) The this pointer of a class is simply a pointer to itself, and can be passed to any functions or any other classes to provide them with a pointer to this particular instance. Consider the following code:
void Frog::Eat() { //do something here this->Jump(); //Calls its own method }