c++ - Is it a good style to use this to refer private member in the class? -


i have class

class t { private:     int x;  public:     int getx() {        return this->x;     } } 

is use this->x rather x itself?

no. perhaps use m_x instead. signify member variable.

perhaps read use of const


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -