Hi guys,
I am new on this forum and I'm a beginner in programming in C and today I feel the need to ask for your help because I am stuck on something that really annoys me a lot.
I have an issue concerning variables that keep letters (sorry if the terms are not correct, I am french and I don't know how it is called in english). I use code blocks IDE
Anyway, have a look on this and please tell me why the "error..." message appears TWICE when I don't press 'r' but an other letter instead!?
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char menu=0;
printf("press 'r' \n");
scanf("%c", &menu);
while (menu !='r')
{
printf("Error!! \n ");
scanf("%c", &menu);
}
return 0;
}