<<<Index>>>

the this keyword


  • Majority of member functions never use the this pointer, because its use within the function is implicit:


class Point {
    // member variables
    int m_x;
    int m_y;

public:
    // member function
    void adjust( int x, int y )
    {
        this->m_x += x; // Ok, but redundant
        this->m_y += y;
    }
};

<<<Index>>>