home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / languages / progs / ctutor / Examples / readtext < prev    next >
Encoding:
Text File  |  1990-10-01  |  338 b   |  18 lines

  1. #include "stdio.h"
  2.  
  3. main()
  4. {
  5. FILE *fp1;
  6. char oneword[100];
  7. int c;
  8.  
  9.    fp1 = fopen("TENLINES.TXT","r");
  10.  
  11.    do {
  12.       c = fscanf(fp1,"%s",oneword); /* got one word from the file */
  13.       printf("%s\n",oneword);       /* display it on the monitor  */
  14.    } while (c != EOF);              /* repeat until EOF           */
  15.  
  16.    fclose(fp1);
  17. }
  18.