Please help this loop won't step out. It keeps asking for input 3 times even when the inputs are correct.
//login with loop
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h> // for gets
int main()
{
char charname[15],charpassword[15],chartryname[10],chartrypassword[15];
int inttrys;
cout<<"Please enter a user name to setup ";
gets(charname);
cout<<"Please enter a password to setup ";
gets(charpassword);
system("cls");
for(inttrys=1; inttrys <=3; inttrys++)
{
cout<<"You have 3 attempts"<<endl;
cout<<"This is attempt number "<<inttrys<<endl;
cout<<"Please enter your user name ";
gets(chartryname);
cout<<"Please enter your password ";
gets(chartrypassword);
if(chartryname==charname && chartrypassword==charpassword)
{
cout<<"\t The details you entered are correct "<<endl;
inttrys = 4;
}
else
{
cout<<"\t The details you entered are incorrect "<<endl;
} //end of if statment
} //end of loop
system("PAUSE");
return 0;
} //end main