书中页数:P282 代码名称:buf.cc
#include <iostream>
using std
::endl
; using std
::flush
; using std
::ends
;
using std
::unitbuf
; using std
::nounitbuf
; using std
::cout
;
int main()
{
cout
<< "hi!" << endl
;
cout
<< "hi!" << flush
;
cout
<< "hi!" << ends
;
cout
<< unitbuf
;
cout
<< "first" << " second" << endl
;
cout
<< nounitbuf
;
return 0;
}
转载请注明原文地址: https://yun.8miu.com/read-133053.html