In GCC v4.6, I am encountering a strange problem. If I try to get a character input and a int input like this:
the compiled program asks for input only one time. On the other hand, if I do the char scanf earlier like this:Code:int main() { int a; char b; scanf("%d",&a); scanf("%c",&b); }
it asks for input twice. Any idea why this behaviour?Code:int main() { int a; char b; scanf("%c",&b); scanf("%d",&a); }