[求助]书上的源程序,编译出错!
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
char filename[20];
cout<<"enter name for new files:";
cin>>filename;
ofstream fout (filename);
fout<<"for only your eyes!\n";
cout<<"Enter your secret number:";
float secret;
cin>>secret;
fout<<"your secret numbers is "<<secret<<"\n";
fout.close();
ifstream fin(filename);
cout<< "Here are the corrects of "<<filename<<":\n";
char ch;
while(fin.get(ch))
cout<<ch;
cout<<"done!";
fin.close();
return 0;
}
[此贴子已经被作者于2007-1-9 13:07:02编辑过]