I don't think it's possible just using the standard libraries.
You might be able to find something in here that will work for you, though: http://www.cplusplus.com/articles/E6vU7k9E/
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.
at the top where the rest of your #include s are, and then put
void echo(bool on);
somewhere above main() (doesn't really matter where), and then put the definition for that function where all of your other functions are (below the main function, presumably).
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.
Gahhhh i swear the advance requirements are just weird. there are simpler ones like changing the colours, and ridiculously difficult ones like this one
You are seriously ahead of your class if you realize that.
All terminal I/O is ridiculously difficult. Heck, all normal I/O is itself much more difficult than people are led to believe. Playing with I/O == more grief than I really want to deal with.
It's the people who take the time to do it right that are smart. (Good job, then!)