_getch() returns the character when a key is pressed, so you could do something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// loop condition: get a character, while it isn't a newline (end of password), then...
while ((c=_getch()) != '\n')
// put it onto the back of the password
// output a '*' character
If you want that there be a facility to change the password at runtime, then use file-handling. Save the desired password in a .dat or .txt file and write a function to truncate the fle and enter the new password.