Perhaps a fictitious question, but I need a clear answer. Is there any difference in returning any of these functions
int FileExists(const std::string& filename)
{
ifstream file(filename.c_str());
return !!file;
}
int FileExists(const std::string& filename)
{
ifstream file(filename.c_str());
return file.is_open();
}
So in other words, my question is: does fstream output for bool produce exactly the same result as fstream :: is_open ()?
source
share