while (getchar () != '\n' );

前端 未结 6 548
囚心锁ツ
囚心锁ツ 2021-01-03 17:08

I have the following for loop, I am prompting the user to enter a 4 digit pin and hit enter. Can someone explain to me what the while loop is really doing because I don\'t f

6条回答
  •  不知归路
    2021-01-03 18:13

    **The function of this while loop is to clear the users' illegal input .When the input is '\n' ,the loop ends.

提交回复
热议问题