第八章课后练习题(P327_4_1)

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
char k;
int i;
ofstream outf("c:\\tmp\\tem.dat",ios::trunc);
outf << "Hello world.";
outf.close();

ifstream inf("c:\\tmp\\tem.dat");
char str[100];
while((k=inf.get())!=EOF)
cout << k << endl;
inf.close();
system("pause");
return 1;
}

posted @ 2020-04-15 09:27  CollisionDimension  阅读(90)  评论(0)    收藏  举报