Closed timhallmann closed 3 months ago
Also cr
needs to be an int
not a char
if you want to reliably store EOF
(notice that getchar()
returns an int
and not a char
specifically due to this reason). More detailed info: https://c-faq.com/stdio/getcharc.html
Instead of skipping every other char (and thus possibly newlines), skip only immediately after a newline.