August 19th, 2013, 07:21 AM
Char reading problem
But when i execute using gcc compiler it only takes 1 value.
Then the result is printed and program finishes.
I tried fflush(stdin) and getchar but no effect.
Why this happens and how can i fix it?
August 19th, 2013, 08:05 AM
its because after entering first char there is \n in your buffer.
to solve this problem add white space before %c.
Comments on this post
August 19th, 2013, 11:54 PM