|
Description
This opens a file and
displays its contents on the screen
Code
/* amethod for
displaying the contents of a file
no error checking*/
#include <stdio.h>
void main(void)
{
FILE *fp;
char ch;
fp = fopen("websites.txt","r");
ch = getc(fp);
while(ch!=EOF)
{
putchar(ch);
ch = getc(fp);
}
printf("\n\n");
}
Information
Tested in Visual C++
, LCC Win 32 and Dev C++
|