home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_10
/
8n10094a
< prev
next >
Wrap
Text File
|
1990-07-23
|
429b
|
19 lines
#include <stdio.h>
main()
{
/* using the returned values in conditional statements */
FILE *fp;
char buff[181];
int more_data;
if ((fp = fopen("MYFILE.DAT","r")) == NULL)
printf("file not found\n");
else {
printf("file found\n\n");
/* loop and print until we reach the end of file */
while ((more_data = fgets(buff, 180, fp)) != NULL)
printf(buff);
}
}