Ok, so I got an error when I tried to print something based on the user's input. Pretty standard stuff, right? So, if the program would have worked correctly, the user would have entered six words or phrases that would be stored in the string named PhrasesAndWords. Then, each part of the array would have been tested, by creating a while-loop, using the counter as the index in the switch statement. Well, apparently, this didn't work, because it wasn't a constant expression, or a constexpr. The variable can't be a constant expression, though, since that would result in an infinite loop. By the way, here is the error:
C:\Users\henry\Desktop\NotTheActualPathForThisProject\main.cpp|34|error: switch quantity not an integer|
Aaand here's the code I wrote (I have gotten rid of irrelevant variables and such, though):
int main() {
string phrasesAndWords[6];
cin >> phrasesAndWords[0] >> phrasesAndWords[1] >> phrasesAndWords[2] >> phrasesAndWords[3] >> phrasesAndWords[4] >> phrasesAndWords[5]; // Recieve input
int counter = 0;
while (counter < 6) {
switch(phrasesAndWords[counter]) {
case "RandomString":
print("That sure was quite random. \n")
default:
print("I don't understaahnd... \n")
};
counter++;
};
};