home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
datafiles
/
text
/
c_tutor
/
readchar.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
390b
|
19 lines
#include "stdio.h"
main()
{
FILE *funny;
int c;
funny = fopen("TENLINES.TXT","r");
if (funny == NULL) printf("File doesn't exist\n");
else {
do {
c = getc(funny); /* get one character from the file */
putchar(c); /* display it on the monitor */
} while (c != EOF); /* repeat until EOF (end of file) */
}
fclose(funny);
}