Advertisement
dllbridge

Untitled

Nov 25th, 2021
899
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6. #include <stdio.h>
  7.  
  8.  
  9.  
  10. int foo();
  11.  
  12.  
  13.  
  14.  
  15. static int nG;
  16.  
  17. ///////////////////////////////////////////////////////
  18. int main()                                           //
  19. {
  20.  
  21.  
  22.     printf("nG = %d \n", foo() );
  23.     printf("nG = %d \n", foo() );
  24.     printf("nG = %d \n", nG );
  25.  
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32. ///////////////////////////////////////////////////////
  33. int foo()                                            //
  34. {
  35.  
  36.     static int nG = 88;
  37.  
  38.  
  39.     nG ++;
  40.  
  41. return nG;
  42. }
  43.  
  44.  
  45.  
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement