1
小白求助 有关c++文件I/O
我在我的桌面上新建了一个text.txt,然后代码如下
#include
#include
using namespace std;
int main(){
ifstream in;
in.open("text.txt");
if(!in){
cerr<<"打来文件失败"<
system("pause");
return 0;
}
char x;
while(in>>x){
cout<<x;
}
cout<<endl;
in.close();
system("p1ause");
}
为何总是打不开文件啊??
youzhihua11
2017/05/14 11:36- c++
- 点赞
- 收藏
- 回答
满意答案