C++中的const在多维指针中的应用
void func1(){const int** pp;//两个**后,禁止赋值pp=new const int*[1];pp[0]=new int[1];//pp[0][0]=0;//error: assignment of read-only location}void func2(){int const ** pp;//两个**后,禁止赋值pp=new const int*[1];pp[0]=new int[1];//pp[0][0]=0;//error: assignment of read-only location}void func3(){int *const * pp;//两个*后,禁止赋值pp=(int *const*)(new int *[1]);//pp[0]=new int[1];//error: assignment of read-only locationpp[0][0]=0;}int main(){return 0;}