how "%c" specification works with scanf()? -


i have following code

char c; scanf("%c",&c); 

now have read "%c" consume whitespaces including enter.but why when press enter (before pressing character) %c not accepting it?

so why accept enter key present in buffer due previous calls , not accept enter key before pressing character?

i assume question why inputs, including enter, not passed scanf(). not %c or %d or other type. see, special characters esc not passet io functions. recognized by, instance, console opens when executing code.


Comments

Popular posts from this blog

Change the color of an oval at click in Java AWT -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -