August 19th, 2013, 06: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, 07: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, 10:54 PM