What is ‘this’ Pointer (object) in C++
When a member function is called, it is automatically passed an implicit argument that is a pointer to the invoking object (that is, the object on which the function is called).This pointer is called this.Within a member function, the members of a class can be accessed directly, withoutany object or class qualification. The this pointer points to the object that invoked the member function. Also the this pointer is automatically passed to all member functions. Another thing to note is that the friend functions are not members of a class and, therefore, are not passed a this pointer. Second, static member functions do not have a this pointer. e.g. class Stack { int top; int size; Stack (int top, int size) { this.top = top; this.size = size; }};

Re: What is ‘this’ Pointer (object) in C++
It should be:
this->top = top;
this->size = size;
Not:
this.top = top;
this.size = size;