Possible Duplicate:
const CFoo &bar() const
Which is the meaning of this line?
virtual void Encode (KDataStream & stream) const;
What´s the meaning of const at the end in C++?
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’s a statement that declares a function.
virtualmeans it’s a member function that can be overridden by a function of the same name and compatible parameter and return types declared in a class derived from this one. The correct version will be chosen (at run-time, if necessary) according to the type of the object it’s invoked on.voidmeans it doesn’t return anything.Encodeis the name of the function.(marks the start of the parameter list.KDataStreamis the type of the first parameter.&means the parameter is passed by reference.streamis the name given to the parameter; it serves as documentation, but can be left out of the declaration without changing the meaning.)marks the end of the parameter list.constmeans that it’s a member function that can’t modify non-static, non-mutable data members of the object it’s invoked on. It also allows it to be invoked on objects that are declaredconst.;marks the end of the statement.