In the following code:
Very simple code but the behavior is strange: it seems only take one in every two inputs, or ignore the other. It is better to run it and know what I am saying. Why? The compiler is VC6++.
Code:
#include <stdio.h>
main()
{
char ch;
while (TRUE) {
scanf("%c",ch);
if (ch == 'a') printf("Yes");
}
}
Very simple code but the behavior is strange: it seems only take one in every two inputs, or ignore the other. It is better to run it and know what I am saying. Why? The compiler is VC6++.