请高手指教
#include<iostream.h>
#include<fstream.h>
#include<stdlib.h>
void main()
{
fstream outfile,infile;
outfile.open("text.dat",ios::out);
if(!outfile)
{
cerr<<"Can not open the file"<<endl;
exit(0);
}
outfile<<"aaaaaaaaaaaaaaa"<<endl;
outfile<<"111111111111111"<<endl;
outfile<<"***************"<<endl;
outfile<<"999999999999999"<<endl;
outfile.close();
infile.open("text.dat",ios::in);
if(!infile)
{
cerr<<"Can not open the file"<<endl;
exit(0);
}
char textline[80];
int i=0;
while(!infile.eof())
{
i++;
infile.getline(textline,sizeof(textline));请问这一句怎么理解?
cout<<i<<":"<<textline<<endl;
}
infile.close();
}