Hi
I finally upgraded a code for password i hope you like it.
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
char *tempPassword = new char;
cout << "enter your password: ";
char ch = _getch();
int j = 0;
while (ch != '\r')
{
if (ch == '\b')
{
if (j == 0)
ch = _getch();
else
{
cout << '\b';
cout << " ";
cout << '\b';
j--;
tempPassword--;
ch = _getch();
}
}
else
{
cout << "*";
*tempPassword = ch;
ch = _getch();
tempPassword++;
j++;
}
}
*tempPassword = '\0';
for (; j>0; j--)
tempPassword--;
cout << endl;
return 0;
}
thanks for Ancient Dragon for giving me the code that i upgraded