consider
while(!feof(f)){/**do something**/}
I've read that this is wrong, because it executes the loop also one extra time. Can someone explain why? Seems to me that when the end of the file is reached, feof(f) returns true and so the loop does not get executed one more time. I've tried this and it's working correctly on my machine.
I was redirected from my previous question to a discussion about this.
As seems like that lots of experts considers this wrong, but it's also evident to me that this works in my case, can someone provide a short example in which this works and another in which this doesn't, motivating it?
Thank you.