-
October 10th, 2010, 02:00 AM
#1
EOF problem
Hi, I am having trouble with EOF
* = eof
1.) Hello there*
vs
2.) Hello there
*
When I read ifstream infile >> from a .txt file via a loop, it doesn't add 1.)
for(; {
if (infile.eof()) {
break;
}
infile >> hello >> there;
while(!infile.eof()) {
}
for 1.) it does not go into the loop while 2.) does
How do I make it so 1 and 2 go into the loop?
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
|