Class member functions can be declared as const.When this is done,that function cannot modify the object that invokes it.Also,a const object cannot invoke a non-const objects.However,a const member function can be called by either const or non-const objects.
example:
class{
int some_var;
public:
unt f1() const;
};
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Can you answer this question?
Write Answer1 Answers