home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
253_01
/
readgood.c
< prev
next >
Wrap
Text File
|
1990-02-14
|
618b
|
42 lines
/* Chapter 10 - Program 5 */
#include "stdio.h"
void main()
{
FILE *fp1;
char oneword[100];
char c;
fp1 = fopen("TENLINES.TXT","r");
do {
c = fscanf(fp1,"%s",oneword); /* got one word from the file */
if (c != EOF)
printf("%s\n",oneword); /* display it on the monitor */
} while (c != EOF); /* repeat until EOF */
fclose(fp1);
}
/* Result of execution
This
is
an
example
line.
Line
number
1
This
is
... (Many other lines.) ...
Additional
lines.
Additional
lines.
*/