home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / CTUTOR.ZIP / SOURCE.ZIP / PRINTDAT.C < prev    next >
Text File  |  1985-02-05  |  640b  |  22 lines

  1. #include "stdio.h"
  2.  
  3. main()
  4. {
  5. FILE *funny,*printer;
  6. int c;
  7.  
  8.    funny = fopen("TENLINES.TXT","r"); /* open input file     */
  9.    printer = fopen("PRN","w");        /* open printer file   */
  10.  
  11.    do {
  12.       c = getc(funny);    /* got one character from the file */
  13.       if (c != EOF) {
  14.          putchar(c);      /* display it on the monitor       */
  15.          putc(c,printer); /* print the character             */  
  16.       }
  17.    } while (c != EOF);    /* repeat until EOF (end of file)  */
  18.  
  19.    fclose(funny);
  20.    fclose(printer);
  21. }
  22.