I have the following code:
void takeOrder(void)
{
int stop = 0;
while(stop != 1)
{
printf("What is your order?\n");
printf("%c - fruitShake\n%c - milkShake\n", FRUIT_SHAKE_CHOICE, MILK_SHAKE_CHOICE);
scanf("%c", &typeChoice);
if(typeChoice != FRUIT_SHAKE_CHOICE || typeChoice != MILK_SHAKE_CHOICE)
{
printf("***Error! Wrong type***");
stop = 1;
}
//more code below
}
}
I'm trying to exit the while-loop with the flag "stop", but it doesn't work and it simply continues with the rest of the code below. Is there any way to exit this while-loop with a flag and without using break?