home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / alb_c10 / chap_09 / ch09_05.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-08  |  788 b   |  33 lines

  1. /*********************************************************************
  2. *  CH09_05.C                      printf(), pointeurs et tableaux  *
  3. *********************************************************************/
  4.  
  5. #include<stdio.h>
  6.  
  7. main( void)
  8. {
  9.     int tab[]= { 0, 1, 2}, *ptr= tab;
  10.  
  11.     printf(" adresse tab: %d", tab);
  12.     printf("\n rΘfΘrence: %d , pointeur: %d\n", ptr, *ptr);
  13.  
  14.     printf("\n rΘfΘrence: %d", ptr++);
  15.     printf("\n pointeur: %d", *ptr);
  16.  
  17.     ptr= tab;
  18.     printf("\n\n rΘfΘrence: %d , pointeur: %d", ptr++, *ptr);
  19.     printf("\n rΘfΘrence: %d , pointeur: %d", ptr, *ptr);
  20.  
  21. }
  22. /*
  23.  
  24.  adresse tab: 6750
  25.  rΘfΘrence: 6750 , pointeur: 0
  26.  
  27.  rΘfΘrence: 6750
  28.  pointeur: 1
  29.  
  30.  rΘfΘrence: 6750 , pointeur: 0
  31.  rΘfΘrence: 6752 , pointeur: 1                                      */
  32.  
  33.