home
ASP ASP.net C C++ C# PHP Java JavaScript Powershell VB.net
Read a file
This opens a file and displays it scontents on the screen.
/* a method 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"); }