C++ Stack Frame/Activation Record and ‘this’ pointer

  activation, c++, pointers, stack, this

This is my first post here, if I am messing something up I would appreciate any advice.
Does C++ implement an activation record? My experience with this has been largely with Java so I am unsure if it is the same for other languages.
If so, in C++ is it correct to say that ‘this’ is a pointer to the previous record on the activation stack?
For example:

...
class Example {
private:
    int num;
public:
    void setNum(int num) {
        this->num = num;
    }
...

So the activation stack would have an ‘Example’ object on the stack and then when the function ‘setNum(…)’ is called it would put that call on the activation stack. So ‘this’ would be of type Example* and would point to the ‘Example’ object that is on the stack before the function call. Is that correct?
Thanks all!

Source: Windows Questions C++

LEAVE A COMMENT