about file

hy...

I want to make program..my program want the user can open the file (use fstream)

my problem is... I I want to show the error message when the file want to open is not aviliable

ex:

what file you want to open?: D:/qabil.txt //qabil.txt is not aviliable in the hardisk
====file not aviliable ====
http://stackoverflow.com/questions/839644/get-stdfstream-failure-error-messages-and-or-exceptions

You can't directly do it in c++. But you can use the c function man 3 perror() to get a better message under linux and under windows there is geterror(), getlasterror() and others.
Topic archived. No new replies allowed.