#include <iostream>
using namespace std;
#include <fstream>
#include <cstdlib>
int main()
{
char ch;
fstream readFile;
char input[81];
readFile.open("murphy.txt",ios::in);
if (readFile.fail())
{
cout << "打开文件失败!"<<endl;
}
while(!readFile.eof())
{
//readFile >> input;
//readFile.getline(input,81,'%');
readFile.get(ch);
if (readFile.fail())
{
break;
}
cout << ch;
}
readFile.close();
return 0;
}
文件操作文件的读入
最新推荐文章于 2022-10-11 21:01:36 发布