home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / c / other / learn / parray.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-07  |  294 b   |  18 lines

  1. /* PARRAY.C: Demonstrate pointer to array. */
  2.  
  3. #include <stdio.h>
  4.  
  5. int i_array[] = { 25, 300, 2, 12 };
  6.  
  7. main()
  8. {
  9.    int *ptr;
  10.    int count;
  11.    ptr = &i_array[0];
  12.    for( count = 0; count < 4 ; count++ )
  13.    {
  14.       printf( "array[%d] = %d\n", count, *ptr );
  15.       ptr++;
  16.    }
  17. }
  18.