home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day12 / scope.c / scope.c
Encoding:
C/C++ Source or Header  |  2002-05-04  |  245 b   |  22 lines  |  [TEXT/LMAN]

  1. /* Illustrates variable scope. */
  2.  
  3. #include <stdio.h>
  4.  
  5. int x = 999;
  6.  
  7. void print_value(void);
  8.  
  9. int main( void )
  10. {
  11.     printf("%d\n", x);
  12.     print_value();
  13.  
  14.     return 0;
  15. }
  16.  
  17. void print_value(void)
  18. {
  19.     printf("%d\n", x);
  20. }
  21.  
  22.