novice question file read

Posted by user248247 on Stack Overflow See other posts from Stack Overflow or by user248247
Published on 2010-03-12T01:04:40Z Indexed on 2010/03/12 1:07 UTC
Read the original article Hit count: 357

Filed under:
while(getline(fileIn,line))
{

  fileOut <<line<<endl;


}





while(getline(fileIn,line))
{

  if(fileIn,eof())
   break;
  fileOut <<line<<endl;


}

i have tried both piece of code and it still reads past and does not break. can anyone tell me why?

I am just reading from file and writing to it.

thanks

© Stack Overflow or respective owner

Related posts about c++