|
-
February 9th, 2009, 06:08 AM
#4
Re: Problem opening blank files with ifstream
 Originally Posted by Philip Nicoletti
As you discovered, eof() does not become true untill you actually
attempt a read past the eof.
The normal way is to put the read in the "while" statement (much cleaner
than the peek()) ...
Code:
while (getline(myStream, tempString[a]))
{
//process the line
}
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|