#include<stdio.h>
#include<string.h>
#include<assert.h>
int main()
{
//const 修饰变量,这个变量就称为常变量,不能被修改,但是本质上还是变量
const int num = 10;
const int * p = #//如果放在*的左边,修饰的是*p,表示指针指向的内容,不能通过指针来修改
*p = 20;
printf("%d\n",num);
return 0;
}
微信扫一扫
#include<stdio.h>
#include<string.h>
#include<assert.h>
int main()
{
//const 修饰变量,这个变量就称为常变量,不能被修改,但是本质上还是变量
const int num = 10;
const int * p = #//如果放在*的左边,修饰的是*p,表示指针指向的内容,不能通过指针来修改
*p = 20;
printf("%d\n",num);
return 0;
}
相关推荐