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

  1. /* PSTRING.C: Demonstrate pointer to a string. */
  2.  
  3. #include <stdio.h>
  4.  
  5. main()
  6. {
  7.    int count;
  8.    static char name[] = "john";
  9.    char *ptr = name;
  10.    for( count = 0; count < 4; count++ )
  11.    {
  12.       printf( "name[%d]: %c\n", count, *ptr++ );
  13.    }
  14. }
  15.