#include
char outbuf[BUFSIZ];
int main()
{
setbuf(stdout,outbuf);
puts("Tis is a test of buffered output.\n");
puts(outbuf);
fflush(stdout);
puts(outbuf);
return 0;
}
输出结果:
This is test of buffered output.
This is test of buffered output.
This is test of buffered output.
This is test of buffered output.
求举例讲解一下setbuf()函数
再把程序一句一句讲一下(主要是outbuf与输出流相连这一句有什么作用不懂),多谢了
c语言缓冲区的问题,请懂的人指导一下
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-