O co chodzi z własnym alternatywnym buforem który tworzymy za pomocą
int setvbuf ( FILE * stream, char * buffer, int mode, size_t size );
Po co używamy np własnej deklaracji pamięci w tym przypadku buff skoro możemy NULL i wychodzi na to samo?
#include <stdio.h>
#include <string.h>
int main () {
char buff[1024]; // do czego nam się to przyda?
memset( buff, '\0', sizeof( buff ));
fprintf(stdout, "Going to set full buffering on\n");
setvbuf(stdout, buff, _IOFBF, 1024); // czemu tutaj jest buff a nie NULL ???
fprintf(stdout, "This is tutorialspoint.com\n");
fprintf(stdout, "This output will go into buff\n");
fflush( stdout );
fprintf(stdout, "and this will appear when programm\n");
fprintf(stdout, "will come after sleeping 5 seconds\n");
sleep(5);
return(0);
}