Code Snippets C

#include
int main ()
{
char buffer[256];
FILE *f1, *f2;
f1=fopen ("f1.txt","w");
f2=fopen ("f2.txt","a");
setbuf ( f1 , buffer );
fputs ("This is sent to the buffered stream: file1",f1);
fflush (f1);
setbuf ( f2 , NULL );
fputs ("This is sent to the unbuffered stream: file2",f2);
fclose (f1);
fclose (f2);
return 0;
}