i want the password to be the inverted login.e.g
logname=2345
password=5432
i have written the following code but it is not doing well!
char temp[10],temp1[10],temp2[10];
bool state=false;
cout<<"Enter the ID(10 characters long): ";
cout.flush();
gets(temp1);
for(count=0,counter=9;count<10;count++,counter--)
temp2[count]=temp1[counter];
temp2[count]='\0';
cout<<"Enter the Password(10 characters long): ";
do
{
cout.flush();
temp[0]= getch();
cout<<"*";
cout.flush();
temp[1]= getch();
cout<<"*";
cout.flush();
temp[2]= getch();
cout<<"*";
cout.flush();
temp[3]= getch();
cout<<"*";
cout.flush();
temp[4]= getch();
cout<<"*";
cout.flush();
temp[5]= getch();
cout<<"*";
cout.flush();
temp[6]= getch();
cout<<"*";
cout.flush();
temp[7]= getch();
cout<<"*";
cout.flush();
temp[8]= getch();
cout<<"*";
cout.flush();
temp[9]= getch();
cout<<"*";
if( strcmp ( temp , temp2 ) == 0 )
state = true;
else
cout<<"Wrong password\n";
}while (state == false);