标签:names namespace open stream std ios cin pen 文本
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream ifle;
char fn[20],ch;
cout<<"输入文件名:";
cin>>fn;
ifle.open(fn);
if(!ifle)
{
cout<<fn<<"文件不能打开"<<endl;
return 0;
}
while((ch = ifle.get())!=EOF)
cout<<ch;
cout<<endl;
ifle.close();
return 1;
}
标签:names namespace open stream std ios cin pen 文本
原文地址:https://www.cnblogs.com/zhongxiaozheng/p/12757898.html