qfedu-c-level/day12/d6_2.c

14 lines
255 B
C
Raw Normal View History

#include <stdio.h>
int main()
{
const int m = 10;
const int *p = &m; // 地址可以赋值给指针变量
int n = 50;
p = &n; // 可以修改指针变量的指向,指针从指向 m 变成指向 n
printf("%d\n", *p);
return 0;
}