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++ 3.0r4 - <b>setbuf</b> 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);

   ANSI

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. buffaw 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>
   #include <stdlib.h>

   char buffer[BUFSIZ];
   FILE *fp;

   int main()
   {
       fp = fopen("file.dat","r");
       setbuf(fp,buffer);
       printf("Stream has been set to buffer\n");
       return EXIT_SUCCESS;
   }

See Also

   setvbuf




See Also: setvbuf

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