Advertisement
dllbridge

Pointer

May 18th, 2022
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1.  
  2. #include   <stdio.h>
  3.  
  4.  
  5. int *pointer =  0;
  6. int       nA = 81;
  7.  
  8. void foo();
  9.  
  10.  
  11.  
  12. ///////////////////////////////////////////////////////////////////////////////
  13. int main()                                                                   //
  14. {
  15.  
  16.     int nB = 4444;  
  17.    
  18.     pointer = &nB;
  19.  
  20.     foo();
  21.    
  22.     printf("(from main) nB = %d \n", nB);
  23. }
  24.  
  25.  
  26.  
  27. ///////////////////////////////////////////////////////////////////////////////
  28. void foo()                                                                   //
  29. {
  30.    
  31.      printf("(from  foo) nB = %d \n", *pointer);
  32.    
  33. }
  34.  
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement