I would probably go with:
ifstream my_file("test.txt");
if (my_file.good())
{
// read away
}
The good
method checks if the stream is ready to be read from.
I would probably go with:
ifstream my_file("test.txt");
if (my_file.good())
{
// read away
}
The good
method checks if the stream is ready to be read from.