#include <stdio.h> |
/* BUFSIZ is defined in stdio.h */ |
char outbuf[BUFSIZ]; |
int main( void ) |
{ |
/* attach a buffer to the standard output stream */ |
setbuf (stdout, outbuf); |
/* put some characters into the buffer */ |
puts ( "This is a test of buffered output.\n\n" ); |
puts ( "This output will go into outbuf\n" ); |
puts ( "and won't appear until the buffer\n" ); |
puts ( "fills up or we flush the stream.\n" ); |
/* flush the output buffer */ |
fflush (stdout); |
return 0; |
} |