#include <iostream> #include <fstream> using namespace std; int main() { ifstream file("myfile.txt"); if(!file) // checks the existence of file cout<< "file was not found "; return 0; }