游戏网站建设公司,网页设计类型与风格,东莞市住房和城乡建设厅网站首页,去空格网站const int *p a; 指向const变量的指针
指向const变量的指针const修饰的变量#xff0c;只能由指向const变量的指针去指向 p a1;const的位置#xff0c;必须在*的左边指向const变量的指针#xff0c;可以被改变#xff0c;可以指向别的变量可以指向普通变量 a; 指向const变量的指针
指向const变量的指针const修饰的变量只能由指向const变量的指针去指向 p a1;const的位置必须在*的左边指向const变量的指针可以被改变可以指向别的变量可以指向普通变量也可以指向const变量
int a 2 ;
int b 3 ;
const int c 10; //也可以指向const变量
const int * p a; //可以指向普通变量
const int * p c; //也可以指向别的变量*p a; //禁止修改p指向的值a 10; //4可以被改变
p b; //4可以指向别的变量int * const p a;被const修饰的指针
int a 10 ;
int b 20 ;
int *const p2 b;
*p2 20 ; // 可以修改修改p2指向的值
p2 a; //不能用来指向别的变量