The compiler says the opposite...
Printable View
The compiler says the opposite...
>It is perfectly fine.
How is that? The open member function for ifstream returns void, so you can't use the return value as a test for success. One would need to call the is_open member function to check the status.
Code:ifstream winfilein("wins.txt"); // ios_base::in is defaulted
if (winfilein.is_open()) {
winfilein.close();
// blahblah
}
doh... it returns void? :o
that would help, thx