home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
datafiles
/
text
/
c_tutor
/
printdat.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
525b
|
22 lines
#include "stdio.h"
main()
{
FILE *funny,*printer;
int c;
funny = fopen("TENLINES.TXT","r"); /* open input file */
printer = fopen("PRN","w"); /* open printer file */
do {
c = getc(funny); /* got one character from the file */
if (c != EOF) {
putchar(c); /* display it on the monitor */
putc(c,printer); /* print the character */
}
} while (c != EOF); /* repeat until EOF (end of file) */
fclose(funny);
fclose(printer);
}