出处:http://blog.csdn.net/shuilan0066/article/details/4669451
1、
ifstream in("config.txt", ios::in); if (!in) { cerr << "open file failed!"; exit(-1); } while(in.peek()!=EOF) { //do something }
出处:http://blog.csdn.net/shuilan0066/article/details/4669451
1、
ifstream in("config.txt", ios::in); if (!in) { cerr << "open file failed!"; exit(-1); } while(in.peek()!=EOF) { //do something }