Putting space after before the % does the trick. I once ran into this in one of my first C assignments.
scanf(" %c", &mychar);
The reason this works is that the first space flushes stdin and then lets the user input the character.
Cheers.
Putting space after before the % does the trick. I once ran into this in one of my first C assignments.
scanf(" %c", &mychar);
The reason this works is that the first space flushes stdin and then lets the user input the character.
Cheers.
1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!