1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream> #include <fstream> using namespace std; int main() { ifstream myfile; myfile.open ("xx.txt"); if(!myfile.is_open()) { cout << "not open" << endl;} cout << "Hello World" << endl; }
1 2
not open Hello World