指针变量 如果指向的这块内存空间 已经被系统回收,程序员是不能使用这块内存

# include<stdio.h>
# define PI 3.14 
/*
 指针变量 如果指向的这块内存空间 已经被系统回收,程序员是不能使用这块内存 


*/
f( int** qaddress){
  int j = 5;
 // *qaddress <-> 等价于 main函数中的q变量 
  *qaddress = &j; 
   
  printf("j的地址为%#x\n",&j); 
    

main(){
         
       int* q; 
       
       int** qaddress = &q; //得到q的地址 
       
   
       f(qaddress); 
       
       printf("q表示的地址为 %#x\n",q); 
       
       printf("*q=%d\n",*q);
       
       system("pause");      

猜你喜欢

转载自blog.csdn.net/yangxingda188/article/details/23327809