I'm new to C++. So I made this program that's supposed to be a password thingy. The problem is that when I input the correct password, which is "bobby", it goes straight to the else and not the if.
What is the problem ?
My Code :
#include <iostream>
using namespace std;
int main()
{
char password[] = "bobby";
char passinput[50];
char num[50];
top:
cout << "Please enter your password: " << endl;
cin >> passinput;
if(passinput==password)
{
cout << "Correct" << endl;
cin >> num;
}
else
{
cout << "Incorrect, try again" << endl;
goto top;
}
}