The problem I am having is that my program is not recognizing my password and when I enter the wrong password three times the program prints the "Wrong, try again" message before it prints the "See system administrator" message. Any help would be appreciated. My code is as follows:
// Password Program
#include<iostream.h>
int main()
{
const int MAX=80;
char password[MAX];
int count=0;
cout<<endl;
cout<<"Enter a password to gain access to the Calendar Program:";
cout<<endl;
while (count<3)
{
cin.getline(password,MAX,'\n');
if (password=="secret")
count=99;
else
{
cout<<"\nWrong password, please try again.\n";
count++;
}
}
if (count==99)
cout<<"Welcome to the Calendar Program";
if (count==3)
cout<<endl;
cout<<"\nSee your system administrator";
cout<<endl;
cout<<endl;
cout<<endl;
return 0;
}