I have made this code for a password (displays '*' when you type)that works fin but i have 2 questions:
*(mark 1)Why does the code not work good when I use coud instead of printf
*(mark 2)If I do:
some crap will be displayed after the password, why is that??Code:cout<<password;
Code:char password[5]; for(int i=0;i<5;i++) { while(!kbhit()) { printf("*") //mark 1 password[i]=getch(); } } printf("Password was: "); for(int x=0;x!=i;x++) // mark 2 cout<<password[x]; //