#include <stdio.h>
int main(void)
{
char buffer[256];
FILE * myfile;
myfile = fopen("some.txt","r"); //opens and file for reading
while (!feof(myfile)) //tests whether end of file is reached and continues to read as long as end is not reached
{
fgets(buffer,256,myfile);
printf("%s",buffer);
}
fclose(myfile);
return 0;
}
0 comments:
Post a Comment