Confused about getchar() function

后端 未结 6 1682
有刺的猬
有刺的猬 2021-02-07 08:25

I am confused about getchar()\'s role in the following code. I mean I know it\'s helping me see the output window which will only be closed when I press the En

6条回答
  •  终归单人心
    2021-02-07 08:47

    getchar() blocks your program's execution until a key is pressed. So, there's no error if no key is pressed, getchar() will wait for it to happen :)

提交回复
热议问题