一、linux下高级应用编程--stdio.h

来源:互联网 发布:辽宁广电网络 编辑:程序博客网 时间:2024/04/28 19:51

stdio.h 标准函数输入/输出

<stdio.h>头文件中用一些整数定义下列一些宏:

BUFSIZ:<stdio.h>中缓冲区的大小
_IOFBF:输入/输出全缓冲.
_IOLBF:输入/输出行缓冲.当向缓冲区输入一个换行符时,缓冲区的内容会被flush。
_IONBF:输入/输出不缓冲.
L_ctermid
[CX] [Option Start]Maximum size of character array to holdctermid() output.[Option End]
L_tmpnam
Maximum size of character array to hold tmpnam() output.
SEEK_CUR
Seek relative to current position.
SEEK_END
Seek relative to end-of-file.
SEEK_SET
Seek relative to start-of-file.

The following macros shall be defined as positive integer constant expressions which denote implementation limits:

{FILENAME_MAX}
Maximum size in bytes of the longest filename string that the implementation guarantees can be opened.
{FOPEN_MAX}
Number of streams which the implementation guarantees can be open simultaneously. The value is at least eight.
{TMP_MAX}
Minimum number of unique filenames generated by tmpnam(). Maximum number of timesan application can call tmpnam() reliably. The value of {TMP_MAX} is at least 25.[XSI][Option Start] On XSI-conformant systems, the value of {TMP_MAX} is at least 10000.[Option End]

The following macro name shall be defined as a negative integer constant expression:

EOF
End-of-file return value.

The following macro name shall be defined as a null pointer constant:

NULL
Null pointer.

The following macro name shall be defined as a string constant:

P_tmpdir
[XSI] [Option Start]Default directory prefix fortempnam().[Option End]

定义函数:int fflush(FILE *stream)

函数说明:fflush()会强迫将缓冲区内的数据写回参数stream指定的文件中。如果参数stream为NULL, fflush()会将所有打开的文件数据更新。
返回值   :成功则返回0,  失败返回EOF, 错误代码存于errno中

原创粉丝点击