// int * const b = &a; void func(int &b){ // *b = 100 b= 100; } int main(){ int a = 10; // int * const b = a; 指针常量是指针方向不可修改,也说明引用不可修改 int &b = a; // *b = 20; b = 20; func(a); return 0; }
标签:const,常量,int,C++,func,指针 From: https://www.cnblogs.com/itniwota/p/16852858.html