home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_03 / 9n03024a < prev    next >
Text File  |  1991-01-10  |  386b  |  23 lines

  1.  
  2. /* 1*/    #include <stdio.h>    /* MS-DOS-specific */
  3.  
  4. /* 3*/    main()
  5. /* 4*/    {
  6. /* 5*/        FILE *fp;
  7. /* 6*/        char filename[] = "\test.dat";
  8.  
  9. /* 8*/        fp = fopen(filename, "r");
  10. /* 9*/        if (fp == NULL)
  11. /*10*/            printf("Can't open file %s\n", filename);
  12. /*11*/        else {
  13. /*12*/            printf("File open\n");
  14. /*13*/            fclose(fp);
  15. /*14*/        }
  16. /*15*/    }
  17.  
  18.  
  19. Output
  20.  
  21. Can't open file  est.dat
  22.  
  23.