What's the actual size of the buffer of printf() function in VC2010?
As we know, printf() will print the string from the buffer in 3 situations, the buffer is full / getting user input / meet '/n' character.
However, I got a situation which didn't satisfy those 3 situations unless the buffer of printf() is less than 1 char....
In the following code, the string "H" only occupy the buffer 1 char unit, but still be printed before the for-looping.
*I'm using ANSI C in programming
#include <stdio.h> #include <limits.h> int main(void) { int n; printf ("H"); for (n = 1; n < INT_MAX; n++) { } printf ("i"); getchar(); return 0; }