#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
char FirstName[50];
char LastName[50];
char MyFirstName[5] = "Bill";
char MyLastName[10] = "Dillinger";
cout << "Enter your first name" << endl;
cin >> FirstName;
cout << "Enter your last name" << endl;
cin >> LastName;
if (FirstName && LastName) {
cout << "Hello " << FirstName << " " << LastName << endl;
} else if(FirstName == MyFirstName && LastName == MyLastName) {
cout << "Hello, my creator!" << endl;
};
system("pause");
return 0;
}
Using the code above, I always get the first result from the if statement. I never get "Hello, my creator!" even if i input my name. How do I fix this code?