const int* p
means you can change the target:
p = &a;
p = &b;
but can not change the value
*p = 100; // WRONG
int* const p
means you can NOT change the target:
p = &a;
p = &b; //WRONG
but can change the value
*p = 100; // YES
const int* const p
All can NOT change
没有评论:
发表评论