Hi I am implementing a function that check if user is a man or woman.
But it does not worl properly.
I press e for example and appears two times
Please press m/M for Man
w/W for
Also sometimes w/W/m/M are not recognised and appears the above.
My cose is :
char ask_if_man_or_woman()
{
char choice_char;
printf("Please answer me (w/m)\n");
scanf("%c",&choice_char);
while((choice_char!='w')&&(choice_char!='W')&&(choice_char!='m')&&(choice_char!='M'))
{
printf("\n\t Please press m/M for Man\n");
printf("\t w/W for Woman\n\n");
scanf("%c",&choice_char);
printf("\n");
}
return choice_char;
}
Any ideas please ????