[問題] 全緩衝 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