I found a comment in an answer saying that using
iostream::eof in a loop condition is "almost certainly wrong". I generally use something like
while(cin>>n) - which I guess implicitly checks for EOF, why is checking for eof explicitly using
How is it different from using
scanf("...",...)!=EOF in C (which I often use with no problems)?