fgets in switch-case problem
Hi,
I have a problem with fgets inside a case where it doesn't even allow me to enter input, it just suddenly goes into the function after or back to the 'choose' menu, can someone tell me why it's like this and how to fix it? Doesn't seem to have any problems outside fo a switch-case statement.
Code:
#define MAX_INPUT 5
char string[5];
switch (choose())
{
case 1:
printf("Enter no more than 5 characters: \n");
fgets(string, MAX_INPUT, stdin);
useInput(string);
break;
case 2:
funct2();
break;
case 3:
funct3();
break;
}