I am just starting C++ so i do not know very much how ever i hope to acomplish a fairly simple program to learn more about C++. Here is the problem:
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
//Variables
char charName[21];
char race[6];
//Intro
cout << "BLAH";
//Character Information
//Name
cout << "Enter a Name:\n" ;
cin.get(charName,21);
cin.ignore(100,'\n');
cout << "Good Morrow, " << charName << '\n';
//Race
cout << "Race: \n";
cin >> race;
while(strcmp(race, "human")!=0)
{
cout << "YOU FAIL! \n...Race: \n";
}
cout << "Name: " << charName << "\n" << "Race: " << race << "\n";
//Class
//Gender
system("PAUSE");
return EXIT_SUCCESS;
}
The While loop works for just "human", i would like it to work for "human" and "elf". I have tried to use the ( || ) but i could not get it to work. If you have any idea what i am doing wrong, what i have to do to make it work, or anything to improve anything else please reply. Thank you
-Scott