using eof in c++
i have to write some code that reads from a file until it reaches the end. it looks kind of like this:
Code:
ifstream input; Code:
aaa Code:
aaa |
ok, i did some research and it seems that this is happening because of how the eof flag gets set. apparently it only gets set when you try to do a read, but nothing is there. so, i guess i could change the while loop to:
Code:
input >> string; |
Sure -
Code:
#include <stdio.h> |
Quote:
ta0kira |
All times are GMT -5. The time now is 07:44 AM. |