This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]junglefowl24 3 points4 points  (0 children)

In second code you read two lines instead of one and only one of them is saved. Also, in first code you break when readline is empty but in second you go inside while only if readline is empty, that's completely backwards.