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)
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!? :shock:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char menu=0;
printf("Regles du jeu\n BLABLABLA...\n");
printf("Appuyer sur R pour retourner au menu\n\n");
scanf("%c", &menu);
while (menu !='r')
{
printf("Erreur, Appuyer sur R pour retourner au menu\n ");
scanf("%c", &menu);
}
return 0;
}