Reading a password from std::cin

后端 未结 4 1123
萌比男神i
萌比男神i 2020-11-22 04:46

I need to read a password from standard input and wanted std::cin not to echo the characters typed by the user...

How can I disable the echo from std::c

4条回答
  •  余生分开走
    2020-11-22 05:38

    Only idea what i have, you could read password char by char, and after it just print backspace ("\b") and maybe '*'.

提交回复
热议问题