home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap16 / indexer.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-07  |  355 b   |  17 lines

  1. /* indexer.c -- use indices to display an array      */
  2.  
  3. #include <stdio.h>
  4. int code1[] = {2, 4, 6, 8};
  5. int code2[] = {1, 3, 7, 9};
  6. int code3[] = {5, 10, 15, 20};
  7. main()
  8. {
  9.     int index;
  10.     int size = (sizeof code2) / (sizeof (int));
  11.  
  12.     for ( index = 1; index <= size; size++)
  13.        printf("%3d ", code2[index]);
  14.     putchar('\n');
  15. }
  16.  
  17.