Possible Duplicate:
what is the difference between const int*, const int * const, int const *
What is the difference between
A const * pa2 = pa1;
and
A * const pa2 = pa1;
(I have some class A for example).
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.
Read the type from right to left:
pa2is a pointer to a read-only A (the object may not be changed through the pointer)pa2is a read-only pointer to A (the pointer may not be changed)This does not mean that A cannot change (or is actually constant) const is misleading, understand it always as read-only. Other aliased pointers might modify A.