填空题
写出下列程序的运行结果______。
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
void main()
fstream outfile,infile;
outfile.open("data.dat" ,ios::out);
if(!outfile)
cout<<"Can’t open the file."<<endl;
abort();
outfile <<"1234567890"<<endl;
outfile<<"aaaaaa.aaa"<<endl;
outfile<<"**********"<<endl;
outfile.close();
in file.open("data.dat",ios::in);
if(!infile)
cout<<"Can’t open the file."<<endl;
abort();
char line[80];
int I=0;
while(!infile.eof())
I++;
infile.getline(line,sizeof(line));
cout<<I<<":"<<line<<endl;
infile.close();
【参考答案】
1:34567890
2:aaaaaaaaa
3:**********
4: