why are you checking the eof before any read operation occurred? eof flag is set by read operation when EOF is encountered. After just opening file it will be false even if the file is empty.
why are you checking the eof before any read operation occurred? eof flag is set by read operation when EOF is encountered. After just opening file it will be false even if the file is empty.
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler