dos_compilers/Mark Williams MWC v4/SAMPLE/EXAMPLE2.C
2024-07-01 16:08:53 -07:00

28 lines
664 B
C

/*
* Let's C Version 4.0.C.
* Copyright (c) 1982-1987 by Mark Williams Company, Chicago.
* All rights reserved. May not be copied or disclosed without permission.
*/
/*Use this program to get better aquainted with the MicroEMACS
*interactive screen editor. You can use this text to learn
*some of the more advanced editing features of MicroEMACS.
*/
#include <stdio.h>
main()
{
FILE *fp;
int ch;
int filename[20];
printf("Enter file name: ");
gets(filename);
if ((fp =fopen(filename,"r")) !=NULL) {
while ((ch = fgetc(fp)) != EOF)
putc(ch, stdout);
}
else
printf("Cannot open %s.\n", filename);
fclose(fp);
}