Advertisement
Guest User

Untitled

a guest
Aug 4th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement