第八章课后练习题(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;
}

浙公网安备 33010602011771号