- 博客(1)
- 收藏
- 关注
原创 C语言const修饰的指针
const:只读 const 修饰变量,修饰的变量只能读,不能修改 int a; //栈区 const int a; 案例:判断const修饰的变量是否在常量区 char *ptr = “hello”; 能不能将h改为a? hello不能被修改,hello是字符串常量,存在常量区,常量区只能读不能被修改 char str[30] = “hello”; int a = 10; const int *p = &a; const int *const p = &a..
2022-05-11 20:29:03
309
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人