delorie.com/djgpp/doc/libc/libc_692.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

setbuf

Syntax

 
#include <stdio.h>

void setbuf(FILE *file, char *buffer);

Description

This function modifies the buffering characteristics of file. First, if the file already has a buffer, it is freed. If there was any pending data in it, it is lost, so this function should only be used immediately after a call to fopen.

If the buffer passed is NULL, the file is set to unbuffered. If a non-NULL buffer is passed, it must be at least BUFSIZ bytes in size, and the file is set to fully buffered.

See section setbuffer. See section setlinebuf. See section setvbuf.

Return Value

None.

Portability

ANSI/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001

Example

 
setbuf(stdout, malloc(BUFSIZ));


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004