hello, from the man page
I don't quite understand why that is illegal,setbuf() always uses a suboptimal buffer size and should be avoided. You must make sure that both buf and the space it points to still exist by the time stream is closed, which also happens at program termination. For example, the following is illegal:
Code:#include <stdio.h> int main() { char buf[BUFSIZ]; setbuf(stdin, buf); printf("Hello, world!\n"); return 0; }
can anyone explain more about it please.