user-0 提问: stdio缓冲区

回复:
user: user-1
content: 引用 7 楼 qdlgdx_lsy 的回复:[quote=引用 3 楼 zhao4zhong1 的回复:] 先 http://www.microsoft.com/visualstudio/chs/downloads#d-2010-express 点开Visual C++ 2010 Express下面的语言选‘简体中文’，再点立即安装  再参考C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\*.* 要是在ubuntu下呢？[/quote] Linux不是开源的吗？找glibc对应的源代码不难吧。

user: user-2
content: 这个要理解吗。。。

user: user-0
content: 引用 3 楼 zhao4zhong1 的回复:先 http://www.microsoft.com/visualstudio/chs/downloads#d-2010-express 点开Visual C++ 2010 Express下面的语言选‘简体中文’，再点立即安装  再参考C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\*.* 要是在ubuntu下呢？

user: user-3
content: void setbuf ( FILE * stream, char * buffer ); Set stream buffer Specifies the buffer to be used by the stream for I/O operations, which becomes a fully buffered stream. Or, alternatively, if buffer is a null pointer, buffering is disabled for the stream, which becomes an unbuffered stream.  This function should be called once the stream has been associated with an open file, but before any input or output operation is performed with it.  The buffer is assumed to be at least BUFSIZ bytes in size (see setvbuf to specify a size of the buffer).  A stream buffer is a block of data that acts as intermediary between the i/o operations and the physical file associated to the stream: For output buffers, data is output to the buffer until its maximum capacity is reached, then it is flushed (i.e.: all data is sent to the physical file at once and the buffer cleared). Likewise, input buffers are filled from the physical file, from which data is sent to the operations until exhausted, at which point new data is acquired from the file to fill the buffer again.  Stream buffers can be explicitly flushed by calling fflush. They are also automatically flushed by fclose and freopen, or when the program terminates normally.  A full buffered stream uses the entire size of the buffer as buffer whenever enough data is available (see setvbuf for other buffer modes).  All files are opened with a default allocated buffer (fully buffered) if they are known to not refer to an interactive device. This function can be used to either set a specific memory block to be used as buffer or to disable buffering for the stream.  The default streams stdin and stdout are fully buffered by default if they are known to not refer to an interactive device. Otherwise, they may either be line buffered or unbuffered by default, depending on the system and library implementation. The same is true for stderr, which is always either line buffered or unbuffered by default.  A call to this function is equivalent to calling setvbuf with _IOFBF as mode and BUFSIZ as size (when buffer is not a null pointer), or equivalent to calling it with _IONBF as mode (when it is a null pointer).

user: user-4
content: 引用 楼主 qdlgdx_lsy 的回复:对stdio缓冲区完全不知道什么意思？求推荐点资料。  google

user: user-5
content: stdio:Standard Input/Output标准输入输出。在C语言里有这样的一个头文件。用于声明一些输入和输出的函数。

user: user-1
content: 先 http://www.microsoft.com/visualstudio/chs/downloads#d-2010-express 点开Visual C++ 2010 Express下面的语言选‘简体中文’，再点立即安装  再参考C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\*.*

user: user-6
content: stdio其实就是输入输出缓冲区，也没有什么不好理解的

user: user-6
content: 求知帖要顶起