Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <stdio.h>
  2.  
  3. int im_outside = 42;
  4.  
  5. void afunction()
  6. {
  7.     printf("Here is an outside variable as seen from a function %i\n", im_outside);
  8.     printf("But now I'm going to modify it\n");
  9.     im_outside = 27;
  10.     printf("And here it is: %i", im_outside);
  11.     return;
  12. }
  13.  
  14. int main (int argc, const char * argv[])
  15. {
  16.     printf("Here is a variable I can see: %i\n", im_outside);
  17.     afunction();
  18.     return 0;
  19. }