Namespaces
Variants
Views
Actions

setvbuf

From cppreference.com
< c‎ | io
Revision as of 12:14, 10 April 2013 by P12 (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <stdio.h>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
int setvbuf( FILE *stream, char *buffer, int mode, size_t size );
</td>

<td class="t-dcl-nopad"> </td> <td > (until C99) </td> </tr> <tr class="t-dcl ">

<td >
int setvbuf( FILE *restrict stream, char *restrict buffer,
             int mode, size_t size );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C99) </td> </tr> Template:ddcl list end

Sets the internal buffer of the given file stream stream.

Contents

Parameters

stream - the file stream to set the buffer to
buffer - pointer to a buffer for the stream to use
mode - buffering mode to use. It can be one of the following values:
_IOFBF full buffering
_IOLBF line buffering
_IONBF no buffering
size - size of the buffer

Return value

0 on success or nonzero on failure.

Notes

This function may only be used after stream has been associated with an open file, but before any other operation.

buffer may be null, in which case this call only resizes the internal buffer.

See also

Template:c/io/dcl list setbuf
C++ documentation for setvbuf