I have this code
while(1){ printf(\"hello world !\\n\"); fgetc(stdin); }
when this runs and I enter a letter like this:
<
You have two characters there, 'a' and '\n'. That is the problem, because fgetc will only read ONE character. This is the documentation.
'a'
'\n'
If you enter only a '\n' - hit enter only - you will have the expected behaviour.
Hope it helps!