I am trying to make a simple script. The problem I am running into is where I am trying to make a code to where if a person doesn't type in an appropiate letter then the code will say "Please select an appropriate number." If the person was to select a good number (1 to 6), an if statement would evaluate which number was chosen then output the text. However, no matter what number I put in, I always get 'Please select an appropriate number". How do I fix this?
#include <iostream>
using namespace std;
void username(){
cout << "Please enter your username > " << flush;
string name;
cin >> name;
}
void classes(){
const int number1 = 1;
const int number2 = 2;
const int number3 = 3;
const int number4 = 4;
const int number5 = 5;
const int number6 = 6;
cout << "Choose a class from below:" << endl;
cout << "===============================" << endl;
string classes[2][3]{
{"1. Warrior", "2. Hunter", "3. Mage"},
{"4. Warlock", "5. Paladin", "6. Rogue"}
};
if((pick != 1) && (pick != 2 ) && (pick != 3 ) && (pick != 4 ) && (pick != 5 ) && (pick != 6 )) {
Understanding the difference between || and && is very important. Don't go on until you do.