There are always quirks. See the FAQ of this board why checking eof in a loop might sometimes give you unexpected results for another one.
You will also see that when dealing with more complex...