I want to allow users to enter password using command-line interface. but I don't want to display this password on screen (or display "****").
How to do it in C?
Thanks.
Update:
I'm working on Linux only. So I don't actually care about Win or other systems. I tried Lucas' solution and it worked fine. However, I still have another question:
If this is a single process & single thread app, changing setting of termios affects different terminals?
How about 1 process - multi threads, multi processes - multi threads?
Thanks very much.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…