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

  1. /*           la34.c                  */
  2.  
  3. /* Include Files */
  4. #include <stdio.h>
  5.  
  6. /* Function Prototypes */
  7. void p1( int*, int );
  8.  
  9. int main( void )
  10. {
  11.      int int1, int2, int3;
  12.  
  13.      int1 = 3;
  14.      int2 = 7;
  15.      int3 = 2;
  16.  
  17.      p1( &int3, int2 );    
  18.      printf( "Back in main, int1 is %d, int2 is %d, ", int1, int2 );
  19.      printf( "and int3 is %d.\n\n", int3 );
  20.  
  21.      p1( &int3, int3 );
  22.      printf( "Back in main, int1 is %d, int2 is %d, ", int1, int2 );
  23.      printf( "and int3 is %d.\n", int3 );
  24.      return 0;
  25. }
  26.  
  27. void p1( int *i, int j )
  28. {
  29.      *i = *i  +  3;
  30.      j  = 4 * j;
  31.      printf( "In p1, *i is %d, and j is %d.\n", *i, j );
  32. }
  33.