home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc / qc25 / prtstr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-15  |  431 b   |  22 lines

  1. /* PRTSTR.C: Prints strings. */
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. main()
  6. {
  7.    char aline[80], more[80];
  8.    char *strptr;
  9.  
  10.    /* aline = "Another line."; */
  11.    /* Note: This causes a compiler error */
  12.  
  13.    strcpy( aline, "Another line." );
  14.    strcpy( more, aline );
  15.    strptr = aline;
  16.    strcat( aline, "dog" );
  17.    printf( "A line of text." );
  18.    printf( aline );
  19.    printf( more );
  20.    printf( strptr );
  21. }
  22.