Monday, October 26, 2020

, ,

Example Program for setbuf Function in c

 setbuf() function in c programming is used to define how stream should be buffered and this function should be call when a file associated with the stream and a already open file but any input or output shouldn't take place.

Example Program for setbuf Function in c
Example Program for setbuf Function in c

 

Parameter for setbuf() function program

steam is an pointer in this program and a allocated buffer is used.

This function doesn't return any thing.

Example program for setbuf() :-

#include <stdio.h>

int main () {
   char buf[BUFSIZ];

   setbuf(stdout, buf);
   puts("This is functioinc.in");

   fflush(stdout);
   return(0);
}

OUTPUT

This is functioinc.in

0 comments:

Post a Comment