flushbuf.cpp
来自「高永强 全C编程源码 清华大学出版社 2002年六月第一版」· C++ 代码 · 共 22 行
CPP
22 行
#include <stdio.h>
#include <iostream.h>
/* BUFSIZ is defined in stdio.h */
char outbuf[BUFSIZ];
void main( )
{
/* attach a buffer to the standard output stream */
setbuf(stdout, outbuf);
/* put some characters into the buffer */
cout << BUFSIZ << endl;
cout << "This is a test of buffered output." ;
cout << "This output will go into outbuf" ;
cout << "and won't appear until the buffer" << endl;
cout << "fills up or we flush the stream." << endl;
/* flush the output buffer */
cout.flush( );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?