为了缓冲区大小的更灵活的动态增长,应该是分配在堆里。
在微软技术库里,找到一篇文章。
**The function printf() takes up 512 bytes from the default heap in 16-bit applications and 4096 bytes in 32-bit applications.
The standard I/O buffer gets allocated only when needed. This gives the program an extra 512 bytes of near-heap space in small and medium memory models or an extra 512 bytes of far-heap space in compact and large models. Therefore, when the printf() function is used for the first time, a 512-byte buffer is reserved for I/O, and the subsequent calls to printf() use that buffer.**
详细参考:
http://support.microsoft.com/kb/44725/en