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;
};
Liked By
Write Answer
How can specify a const member function?
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
Join MindStick Community
You have need login or register for voting of answers or question.
AVADHESH PATEL
15-Jun-2013