1 /*************************************************************************
 2     > File Name: ptr_variable.c
 3     > Author: Mr.Yang
 4     > Purpose:演示指向变量的指针 
 5     > Created Time: 2017年06月03日 星期六 08时47分33秒
 6  ************************************************************************/
 7 
 8 #include <stdio.h>
 9 #include <stdlib.h>
10 
11 int main(void)
12 {
13         int a = 1000;
14         printf("a的地址为:%d\n",&a);
15 
16         char *p;
17         puts(p);
18         printf("指针p的地址为:%d\n",&p);
19 
20         return 0;
21 }

执行结果:

为什么声明了int型的变量并且直接初始化后,int型变量的地址一直在变化?

这个地址的变应该怎么理解,对于没有初始化的变量来说,地址变可以理解,但已经初始化的变量地址还是一直变,应该怎么理解呢?

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-03
  • 2022-01-18
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2021-08-09
相关资源
相似解决方案