Replace input with “ * ” C++

前端 未结 4 893
春和景丽
春和景丽 2020-12-22 06:21

i want the user to input a passwort. of course it\'s a secret passwort so nobody should see it. so i tried to replace the letters and numbers the user inputs, with \' * \'.

4条回答
  •  醉酒成梦
    2020-12-22 07:20

    On a posix system use getpass (3).

    It won't give you asterix echos, instead it echos nothing, but it is the way to do it.

    Or if you are on a BSD system you could use readpassphrase (3) which is more flexible than the older call.

提交回复
热议问题