Why does the message print twice?

后端 未结 4 1236
灰色年华
灰色年华 2021-01-15 01:29

I am creating a simple Tic Tac Toe for C, and here is a particular function which I am having a problem with. This is supposed to let the user select \'X\' or \'O\', and fo

4条回答
  •  太阳男子
    2021-01-15 01:58

    The problem cause is related to the newline charachter

    use scanf() in this way instead of using getchar()

    scanf(" %c", &user);
    

提交回复
热议问题