while (food != "burger" && "fries" && "pizza")
This does not mean what you think it means, please refer to Chriscpp's code. With the way it is now, it is the same as writting:
while(food != "burger")
"fries" and "pizza" will always be true. Think of it in the computer's perspective. Say aloud to yourself the word "apple", does it mean anything?
When you input "burger", the reason that this line
cout << "Thanks for choosing " << food << "\n";
doesn't run is because you never entered the while loop in the first place. You input burger, the condition for the while loop evaluates are false and it never gets entered.
Incidentally, this will not do what you want it to do either.
1 2
|
if (food == "burger" && "fries" && "pizza") {
cout << "Thanks for choosing " << food << "\n";
|
I'm going to assume you're going to follow Chris's example and compare "fries" and "pizza" with food. food can never be "burger", "fries" and "pizza" at the same time, so you might want || rather than &&.
On a final note, you might want to study how Chris placed the curly braces in his code more closely.