I was trying to create a program that would require the correct password to be put in in order for it to display something. I was able to make a program that would require the right password to display a certain thing. But the problem is that it can only be a one letter password :(
This the the program that I made:
#include <iostream>
using namespace std;
int main()
{
char a;
char b = 'i';
cout<<"Enter password: \n";
cin>> a;
if ( a == b ) {
cout<<"Congratulations, you guessed the password!\n";
}
if ( a != b ) {
cout<<"FAIL! :P\n";
}
}
This is a very simple program (as you can see). I would appreciate all help, but I would like it if I didn't have to make it loop. I would also like it if you could help me adding a password function (I think that's what it's called). Thank you in advance!