}
//读出
#include <iostream>
#include <fstream>using namespace std;int main(){ char ch; ifstream fin("test.txt",ios::in); if(!fin){ cout<<"error"<<endl; return 1; } while(fin.get(ch)){ cout<<ch; } fin.close(); return 0;}本文共 610 字,大约阅读时间需要 2 分钟。
}
//读出
#include <iostream>
#include <fstream>using namespace std;int main(){ char ch; ifstream fin("test.txt",ios::in); if(!fin){ cout<<"error"<<endl; return 1; } while(fin.get(ch)){ cout<<ch; } fin.close(); return 0;}转载于:https://www.cnblogs.com/wangjianupc/p/10587221.html