[问题] 全缓冲 and 行缓冲

楼主: yshihyu (yshihyu)   2015-06-30 00:34:39
https://gist.github.com/anonymous/ea35546dcd2507b48571
我使用linux 系统 , gcc ,
stdout 是行缓冲 , stderr 是无缓冲
程式运行结果是 , hello-err 先印出10次之后
再一口气印hello-out 10次
这样看起来 hello-out 先存在buffer
想请问一下行缓冲跟全缓冲的所用的buffer 是同个 buffer 嘛?
谢谢
作者: scwg ( )   2015-06-30 02:40:00
每个 file handle 有各自的 buffer mode 和 buffer; 参考setvbuf()

Links booklink

Contact Us: admin [ a t ] ucptt.com