home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / MARK_WC1.LZH / SRC / EXAMPLE2.C < prev    next >
C/C++ Source or Header  |  1988-04-27  |  487b  |  22 lines

  1. /*Use this program to get better aquainted with the MicroEMACS
  2.  *interactive screen editor.  You can use this text to learn
  3.  *some of the more advanced editing features of MicroEMACS.
  4.  */
  5. #include <stdio.h>
  6. main()
  7. {
  8.     FILE *fp;
  9.     int ch;
  10.     int filename[20];
  11.     printf("Enter file name: ");
  12.     gets(filename);
  13.  
  14.     if ((fp =fopen(filename,"r")) !=NULL) {
  15.         while ((ch = fgetc(fp)) != EOF)
  16.             putc(ch, stdout);
  17.     }
  18.     else
  19.         printf("Cannot open %s.\n", filename);
  20.     fclose(fp);
  21. }        
  22.