Originally Posted by
Daved
Open for input, not output. std::ifstream is for input.
Yes ofcourse, i knew that <.<
Well, std::ifstream doesn't seem to create a new file when i try to open it, but i'm still not sure how my program would know whether or not ifstream was succesful in opening the file?
Is it possible to do something like this:
Code:
bool file_exists;
file_exists = std::ifstream foo("bar.txt");
So, the bool would be false if ifstream failed in locating the file? In other words, does the constructor for ifstream return a 0 if it fails? And if not, how could i then do it?