2、 先看一段程序。 [cpp]viewplaincopyprint?1.#include 2.#include 3. 4.int global_init_a=1; 5.int global_uninit_a; 6.static int static_global_init_a=1; 7.static int static_global_uninit_a; 8.const int const_global_a=1;
3、 9. 10.int global_init_b=1; 11.int global_uninit_b; 1.static int static_global_init_b=1; 2.static int static_global_uninit_b; 3.const int const_global_b=1; 4./*上面全部为全局变量,main函数中的为局部变量*/ 5.int main() 6.{ 7. int local_init_a=1; 8. int local_uninit_a; 9.
4、 static int static_local_init_a=1; 10. static int static_local_uninit_a; 11. const int const_local_a=1; 12. 13. int local_init_b=1; 14. int local_uninit_b; 15. static int static_local_init_b=1; 16. static int static_local_uninit_b; 17. cons
5、t int const_local_b=1; 18. 19. int * malloc_p_a; 20. malloc_p_a=malloc(sizeof(int)); 21. 22. printf(" &global_init_a=%p t 23. global_init_a=%d",&global_init_a,global_init_a); 24. 25. printf(" &global_uninit_a=%p