Problems with scanf

前端 未结 4 1396
粉色の甜心
粉色の甜心 2020-12-20 09:05
#include 

int main()
{

    char C, B;
    int x;



    printf(\"What comes after G\\n\");
    scanf(\"%c\", &C);

    printf(\"What comes after         


        
4条回答
  •  囚心锁ツ
    2020-12-20 09:38

    You need to eat up the white space (i.e. new line) - as per the manual page http://linux.die.net/man/3/scanf

提交回复
热议问题