Given that you're using system("pause");, it seems that you're using Windows. In that case, you can "hide" the password by doing cout << string(300, '\n'); // Print 300 newlines
which should make the password scroll off of the console screen, unless you've changed the screen buffer size (and if that's the case, then change 300 to a suitably large number, say 10000).
Of course, that still doesn't make the password disappear as you're typing it.
Well it's an advanced requirement. Just fulfilling for extra marks XD I'm doing this on windows. I'm not using that compiler, just the usual iostream, iomanip, string and cmath and I don't think I will?
I emplemented a teqnique for this. Basically, you get each character using getch(), which get's a single key press, but doesn't display it. You can use that to censor your display if you feel up to it.
what is this <conio.h> suppose to do anyway? a classmate who figured out how to do this mentioned that, and something about using a while loop so every time the computer sense a character, they will automatically replace it with a * unless the entry is "enter" or sth like that?
The <conio.h> is a remnant of an ancient Microsoft header (which everyone mis-attributes to Borland) that provided functionality for playing with the console, just like you want. Unless you are using an old Borland compiler, though, it is unlikely to have very much functionality, if it exists at all.
One of the functions in that library allows you to get a single character of input at a time, just as the user presses the key. (This is called unbuffered or "raw" input.)
Stars/asterisks are pretty GUI stuff someone invented without realizing it was a bad idea. You are better off not using them.
If you must, though, google "msdn setconsolemode" to learn more about playing with stuff like unbuffered input (vs the default line-buffered input).
Your friends think they are being cooler, but they are not. Passwords should not show the person over your shoulder how long they are.