What happens if I call ifstream to process data from a file given by the string filename, but this file does not exist?
I assumed I would get an error, but it looks like my program will still run and only ignore the part where I am reading and processing data.
You can check if the file is open with if (!ist) //file is not open . Reading from or writing to an unopened std::fstream will fail silently, which is why it's important to always check the status of the stream.