1

Possible Duplicate:
Get std::fstream failure error messages and/or exceptions

I am using ifstream and I need to make opening of file very robust.

std::ifstream myfilestream(fileName);

if (!(myfilestream.is_open())){  // if not open how do I determine cause?

}

http://www.cplusplus.com/reference/iostream/ifstream/

Thanks

Community
  • 1
  • 1
Androider
  • 21,125
  • 36
  • 99
  • 158
  • Just a side note, cplusplus.com is, although popular, not such a precise source of information. – Shahbaz Dec 08 '11 at 22:04
  • For the reason **why** file does not open: [Getting meaningful error messages from fstream's in C++](http://stackoverflow.com/q/2639324/237483) – Christian Ammer Dec 08 '11 at 22:09

0 Answers0