Second scanf is not working

前端 未结 5 1671
旧巷少年郎
旧巷少年郎 2020-12-06 19:36

i am having trouble with this c language code:

 char st[2];

 printf(\"enter first value:\");
 scanf(\"%c\", &st[0]);

 printf(\"enter second value:\");
         


        
5条回答
  •  误落风尘
    2020-12-06 20:05

    Well it did. The character(s) produced by the ENTER key is present in the buffer already.

提交回复
热议问题