The const Keyword
Applied to a member function, the keyword indicates that the function does not make a change to the receiver: class string { public: ... // computing length does not alter string int length() const; ... };
Only member functions that have been declared as can be used with objects that are themselves declared const.