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

  1. #include "stdio.h"
  2.  
  3. main()
  4. {
  5. FILE *funny;
  6. int c;
  7.  
  8.    funny = fopen("TENLINES.TXT","r");
  9.  
  10.    if (funny == NULL) printf("File doesn't exist\n");
  11.    else {
  12.       do {
  13.          c = getc(funny);    /* get one character from the file */
  14.          putchar(c);         /* display it on the monitor       */
  15.       } while (c != EOF);    /* repeat until EOF (end of file)  */
  16.    }
  17.    fclose(funny);
  18. }
  19.