String has contents even though there is no input from user

后端 未结 4 1668
长情又很酷
长情又很酷 2021-01-29 02:50

I am trying to \"trap\" keyboard inputs from user, meaning the code will prevent them from entering certain characters, which in this case prevents the input of numbers and spec

4条回答
  •  孤独总比滥情好
    2021-01-29 03:04

    since your buffe will get memory on stack it will contain some garbage value you better initialize it with zero or better way is to use memset() function.

提交回复
热议问题