#include
Main () {int C; / * character read from the file. * / file * ptr; / * PoinTer to the file. File is a structure defined in * /
/ * Open the file - no error checking done * / ptr = fopen ("/ etc / hosts", "r"); / * Read One Character At A Time, Checking for the end. EOF Is Defined in as -1 * / while ((c = fgetc (ptr))! = EOF) {Printf ("% c", c); / * o / p the character to the screen * /}
Fclose (PTR); / * close the file. * /}