std::cout << '\b' << '*';
that is the only idea i would have. the \b is the back/delete button. if you do this you need to do
1 2 3 4 5 6 7
std::string s;
while(char c != '\n'){
std::cin >> c;//gets the next char
s += c; //adds char to end of string
std::cout << '\b' << '*';//replace with an asterisk
//there will be a new line char at the end of the name so make sure to delete that
}
WIN32's EDIT class contains this exact feature. It can be enabled quite easily there.
I've never seen a professional console app that does this though. Even telnet, svn, fpt, or ssh commands don't ussually do this. If you were to do it, perhaps using the <curses> library would work well.
EDIT: Actually long double main's solution is really nice and easy. Just copy the getpass() and getch() (if applicable) functions exactly as written. Also don't forget to include the appropriate headers.