home *** CD-ROM | disk | FTP | other *** search
- /*
- * L I S T _ 1
- *
- * Display the contents of an ASCII text file
- * file on the user's screen. Bare-bones version.
- */
-
- #include <stdio.h>
-
- int
- main(void)
- {
- int ch; /* input character */
- FILE *fp; /* file pointer */
-
- /*
- * Open the named file for reading.
- */
- fp = fopen("DOGGEREL.TXT", "r");
-
- /*
- * Read the contents of the file and display
- * each character as it is read.
- */
- while ((ch = fgetc(fp)) != EOF)
- putchar(ch);
-
- /*
- * Close the file.
- */
- fclose(fp);
-
- return (0);
- }
-