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
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.