Well, in this program I want it to take in a string or character array I really don't care which, for this instance I wouldn't know which is better. Afterwords, it compares those in if statements and sets a variable to a 1(female) or 2(male).
Anyways, here is what I have so far:
#include <iostream>
#include <string>
using namespace std;
void intro();
void questions();
char name[50];
int age;
int gender;
int orientation;
int main()
{
questions();
return 0;
}
void questions()
{
string gendercheck;
gender = 0;
cout << "What is your first name?" << endl;
cin >> name;
cout << endl << endl << "Ah " << name << ", I think I am starting remember you now..." << endl
<< "How old are you again?..." << endl;
cin >> age;
cout << endl << endl << "Interesting... mmm." << endl;
do
{
cout << "... Are you a male or a female?..." << endl;
cin >> gendercheck;
if(gendercheck != "male" || gendercheck != "female")
{
cout << endl << "I'm sorry, but I do not recognise the statement \"" << gendercheck << "\"..." << endl;
}
else if(gendercheck == "male")
{
gender = 2;
}
else if(gendercheck == "female")
{
gender = 1;
}
}while(gender != 1 || gender != 2);
}
In the do while statement, no matter what I enter, its always saying the sorry message, even if i say male or female, so I assume im doing something stupid, thats causeing the entered male to be different than "male" in the comparison. I would really appreciate if this could be explained... :D Thanks in advance!