Class newclass
{
private:
....
Public:
void function() const;
};
This const
To tell the compiler that the method should be called on a const object -- i.e. the method shouldn't change any of the member variables.
This is known as a 'const method.'
This is known as a 'const method.'
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement