Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    void setbuf( FILE *fp, char *buffer );

Description:
    The  setbuf function can be used to associate a buffer with the file
    designated by fp.  If this function is used, it must be called after the
    file has been opened and before it has been read or written.  If the
    argument buffer is NULL, then all input/output for the file fp will be
    completely unbuffered.  If the argument buffer is not NULL, then it must
    point to an array that is at least  BUFSIZ characters in length, and all
    input/output will be fully buffered.

Returns:
    The  setbuf function returns no value.

See Also:
    fopen, setvbuf

Example:
    #include <stdio.h>
    #include <stdlib.h>

    void main()
      {
        char *buffer;
        FILE *fp;

        fp = fopen( "file", "r" );
        buffer = (char *) malloc( BUFSIZ );
        setbuf( fp, buffer );
        /* . */
        /* . */
        /* . */
        fclose( fp );
      }

Classification:
    ANSI

Systems:
    All

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