Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - setbuf http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   setbuf

   Usage
   #include <stdio.h>
   void setbuf(FILE *stream,char *buffer);

   Description
   The  setbuf  function  sets the buffering system  for  bytes  read  or
   written  to  a stream. If the buffer argument is NULL, the  stream  is
   unbuffered. If buffer is not NULL, it is taken to be a pointer to  the
   buffer which is to be used for subsequent read and write calls. buffer
   must  point to a character array of size BUFSIZ (defined in  stdio.h).
   The user specified buffer is used then instead of the default  system-
   allocated I/O buffer.

   Example
   #include <stdio.h>
   char buffer[BUFSIZ];
   FILE *fp;
   main()
   {
        fp = fopen("file.dat","r");
        setbuf(fp,buffer);
        printf("Stream has been set to buffer\n");
   }


See Also: setvbuf

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson