常量指针 const int *p=&a; //正确:p=&b; //错误:*p=20; const 放在前,指针所指向的值不能修改。 指针常量 int const *p=&a; //错误:p=&b; //正确:*p=20;