home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / _DISK_ / ch2 / block2.c < prev    next >
C/C++ Source or Header  |  2005-06-16  |  485b  |  21 lines

  1. /*                          block2.c
  2.  *
  3.  *   Synopsis  - This program will not compile.
  4.  *
  5.  *   Objective - To illustrate the fact that variables declared
  6.  *               inside a block are unknown by the rest of the
  7.  *               program.
  8.  */
  9. /* Include Files */
  10. #include <stdio.h>
  11.  
  12. int main( void )
  13. {
  14.      {
  15.           int i;                    /* Note 1 */
  16.           scanf( "%d", &i );
  17.      }
  18.  
  19.      printf( "i is %d.\n", i );     /* Note 2 */
  20.      return 0;
  21. }