Execution skips getchar() in loop after carriage return and putchar()?

前端 未结 2 1497
长情又很酷
长情又很酷 2021-01-14 22:47

It\'s my first time posting here, so hopefully this goes as intended.

I\'m doing one of the early exercises from K&R. The objective is to use getchar() to get a

2条回答
  •  有刺的猬
    2021-01-14 22:54

    while (c != EOF) ends after hitting EOF. Try pressing Ctrl + D after some input.

提交回复
热议问题