I am interested in gathering a password from a user.
When the user is prompted for their password, I want to echo back to them * (asterisks) for each character they input.
void changeEcho() {
termios term;
tcgetattr(STDIN_FILENO, &term);
term.c_lflag &= ~ECHO;
tcsetattr(STDIN_FILENO, TCSANOW, &term);
}
I know that this will turn the echo off, but I am interested in echoing something that I choose, in my case '*'.