#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-12-13 12:02:30 发布