⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setbuf.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
字号:
.func setbuf
#include <stdio.h>
void setbuf( FILE *fp, char *buffer );
.ixfunc2 '&StrIo' &func
.funcend
.desc begin
The &func function can be used to associate a buffer with the file
designated by
.arg 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
.arg buffer
is
.mono NULL,
then all input/output for the file
.arg fp
will be completely unbuffered.
If the argument
.arg buffer
is not
.mono NULL,
then it must point to an array that is at least
.kw BUFSIZ
characters in length, and all input/output will be fully buffered.
.desc end
.return begin
The &func function returns no value.
.return end
.see begin
.seelist setbuf fopen setvbuf
.see end
.exmp begin
#include <stdio.h>
#include <stdlib.h>

void main()
  {
    char *buffer;
    FILE *fp;
.exmp break
    fp = fopen( "file", "r" );
    buffer = (char *) malloc( BUFSIZ );
    setbuf( fp, buffer );
    /* . */
    /* . */
    /* . */
    fclose( fp );
  }
.exmp end
.class ANSI
.system

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -