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

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

python - Pygame screen.blit not working -

c# - Web API response xml language -