Confused about getchar() function

后端 未结 6 1678
有刺的猬
有刺的猬 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:34

    I think what confuses you is that the Enter key is needed befor the program continues. By default, the terminal will buffer all information until Enter is pressed, before even sending it to the C program.

    see discussion of Enter problem here

提交回复
热议问题