|
Sure, EOF is the issue. Your last read grabs the last line and newline. That is not EOF, since you haven't attempted to read beyond it. The "while (fin)" looks fine, so you attempt to read again and hit EOF. You aren't checking for that. This is one of most common novice mistakes.
|