Possible Duplicate:
Meaning of “const” last in a C++ method declaration?
In the below function declaration,
const char* c_str ( ) const;
what does the second const do ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It means the method is a “const method” A call to such a method cannot change any of the instance’s data (with the exception of
mutabledata members) and can only call other const methods.Const methods can be called on const or non-const instances, but non-const methods can only be called on non-const instances.