Bjarne在他的TheC++ProgrammingLanguage里面给出过一个助记的方法:把一个声明从右向左读。char*constcp;(*读成pointerto)cpisaconstpointertocharconstchar*p;pisapointertoconstchar;charconst*p;同上因为C++里面没有const*的运算符,所以const只能属于前面的类型。C++标准规定,const关键字放在类型或变量名之前等价的。constintn=5;//sameasbelowintconstm=10;constint*p;//sameasbelowconst(int)*pin