home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / cdactual / demobin / share / program / C / ANSICPP.ZIP / EX10026.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-24  |  238 b   |  16 lines

  1. // ex10026.cpp
  2. // File error checking
  3. #include <fstream.h>
  4.  
  5. main()
  6. {
  7.     ifstream ifile;
  8.     ifile.open("noname.fil", ios::in | ios::nocreate);
  9.     if (ifile.fail())
  10.         cout << "Cannot open";
  11.     else    {
  12.         // ... 
  13.         ifile.close();
  14.     }
  15. }
  16.