home *** CD-ROM | disk | FTP | other *** search
- main() /* fclose.c -- illustrates use of fclose() */
- {FILE *fp;
- char name[20], c;
-
- printf("Filename: ");
- gets(name);
- clrerr(fp);
- if ((fp = fopen(name,"r")) == NULL)
- exit();
- while((c = getc(fp)) != EOF)
- putchar(c);
- fclose(fp);
-
- }