We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This will not work because the final statement will read a newline character from the previous line. you can fix this by changing the third statement to:
The space in the beginning of the format string tells it to ignore the newline character from the previous line (newlines are considered whitespace here)
Alternatively, and likely a little more clean, you can add the ignore character statement to the first two lines, which will get rid of the newline characters from them allowing the read line statement to work correctly.
Playing With Characters
You are viewing a single comment's thread. Return to all comments →
The low success rate on this makes me think many people did what I did:
This will not work because the final statement will read a newline character from the previous line. you can fix this by changing the third statement to:
The space in the beginning of the format string tells it to ignore the newline character from the previous line (newlines are considered whitespace here)
Alternatively, and likely a little more clean, you can add the ignore character statement to the first two lines, which will get rid of the newline characters from them allowing the read line statement to work correctly.