Standard library header <cstdio>
From cppreference.net
此头文件最初作为 <stdio.h> 存在于C标准库中。
此头文件是 C风格输入输出 库的组成部分。
类型 |
||
|
对象类型,能够保存控制C语言I/O流所需的所有信息
(类型定义) |
||
|
完整的非数组对象类型,能够唯一指定文件中的位置,包括其多字节解析状态
(typedef) |
||
|
由
sizeof
运算符返回的无符号整数类型
(类型别名) |
||
宏 |
||
|
实现定义的空指针常量
(宏常量) |
||
|
类型为
FILE
*
的表达式,关联到输入流
类型为 FILE * 的表达式,关联到输出流 类型为 FILE * 的表达式,关联到错误输出流 (宏常量) |
||
|
EOF
|
类型为
int
且值为负的整型常量表达式
(宏常量) |
|
|
FOPEN_MAX
|
可同时打开的文件数量
(宏常量) |
|
|
FILENAME_MAX
|
存储最长受支持文件名所需的
char
数组大小
(宏常量) |
|
|
BUFSIZ
|
std::setbuf
所使用的缓冲区大小
(宏常量) |
|
|
_IOFBF
_IOLBF
_IONBF
|
传递给
std::setbuf
的参数,表示全缓冲I/O
传递给 std::setbuf 的参数,表示行缓冲I/O 传递给 std::setbuf 的参数,表示无缓冲I/O (宏常量) |
|
|
SEEK_SET
SEEK_CUR
SEEK_END
|
作为
std::fseek
的参数,表示从文件起始位置开始寻位
作为 std::fseek 的参数,表示从当前文件位置开始寻位 作为 std::fseek 的参数,表示从文件末尾开始寻位 (宏常量) |
|
|
TMP_MAX
|
可通过
std::tmpnam
生成唯一文件名的最大数量
(宏常量) |
|
|
L_tmpnam
|
用于存储
char
数组以容纳
std::tmpnam
结果所需的大小
(宏常量) |
|
函数 |
||
文件访问 |
||
|
打开文件
(函数) |
||
|
使用不同名称打开现有流
(函数) |
||
|
关闭文件
(函数) |
||
|
将输出流与实际文件同步
(函数) |
||
|
设置文件流的缓冲区
(函数) |
||
|
设置文件流的缓冲区及其大小
(函数) |
||
直接输入/输出 |
||
|
从文件读取数据
(函数) |
||
|
写入文件
(函数) |
||
无格式输入/输出 |
||
窄字符 |
||
|
从文件流获取一个字符
(函数) |
||
|
从文件流获取字符串
(函数) |
||
|
将字符写入文件流
(函数) |
||
|
将字符串写入文件流
(函数) |
||
|
从
stdin
读取一个字符
(函数) |
||
|
(C++11 中弃用)
(C++14 中移除)
|
从
stdin
读取字符串
(函数) |
|
|
向
stdout
写入字符
(函数) |
||
|
将字符串写入
stdout
(函数) |
||
|
将字符放回文件流
(函数) |
||
格式化输入/输出 |
||
窄字符/多字节字符 |
||
|
从
stdin
、文件流或缓冲区读取格式化输入
(函数) |
||
|
(C++11)
(C++11)
(C++11)
|
从
stdin
、文件流或缓冲区读取格式化输入
使用可变参数列表 (函数) |
|
|
(C++11)
|
将格式化输出打印到
stdout
、文件流或缓冲区
(函数) |
|
|
将格式化输出打印到
stdout
、文件流或缓冲区
使用可变参数列表 (函数) |
||
文件定位 |
||
|
返回当前文件位置指示器
(函数) |
||
|
获取文件位置指示器
(函数) |
||
|
将文件位置指示器移动到文件中的特定位置
(函数) |
||
|
将文件位置指示器移动到文件中的特定位置
(函数) |
||
|
将文件位置指示器移动到文件开头
(函数) |
||
错误处理 |
||
|
清除错误
(函数) |
||
|
检查文件结束符
(函数) |
||
|
检查文件错误
(函数) |
||
|
显示对应于当前错误的字符串到
stderr
(函数) |
||
文件操作 |
||
|
删除文件
(函数) |
||
|
重命名文件
(函数) |
||
|
创建并打开一个临时自动删除文件
(函数) |
||
|
返回唯一文件名
(函数) |
||
概要
namespace std { using size_t = /* 查看描述 */; using FILE = /* 查看描述 */; using fpos_t = /* 查看描述 */; } #define NULL /* 查看描述 */ #define _IOFBF /* see description */ #define _IOLBF /* 查看描述 */ #define _IONBF /* 查看描述 */ #define BUFSIZ /* 见描述 */ #define EOF /* 查看描述 */ #define FOPEN_MAX /* 查看描述 */ #define FILENAME_MAX /* see description */ #define L_tmpnam /* 查看描述 */ #define SEEK_CUR /* 查看描述 */ #define SEEK_END /* 查看描述 */ #define SEEK_SET /* 查看描述 */ #define TMP_MAX /* 参见描述 */ #define stderr /* 查看描述 */ #define stdin /* 查看描述 */ #define stdout /* 查看描述 */ namespace std { int remove(const char* filename); int rename(const char* old_p, const char* new_p); FILE* tmpfile(); char* tmpnam(char* s); int fclose(FILE* stream); int fflush(FILE* stream); FILE* fopen(const char* filename, const char* mode); FILE* freopen(const char* filename, const char* mode, FILE* stream); void setbuf(FILE* stream, char* buf); int setvbuf(FILE* stream, char* buf, int mode, size_t size); int fprintf(FILE* stream, const char* format, ...); int fscanf(FILE* stream, const char* format, ...); int printf(const char* format, ...); int scanf(const char* format, ...); int snprintf(char* s, size_t n, const char* format, ...); int sprintf(char* s, const char* format, ...); int sscanf(const char* s, const char* format, ...); int vfprintf(FILE* stream, const char* format, va_list arg); int vfscanf(FILE* stream, const char* format, va_list arg); int vprintf(const char* format, va_list arg); int vscanf(const char* format, va_list arg); int vsnprintf(char* s, size_t n, const char* format, va_list arg); int vsprintf(char* s, const char* format, va_list arg); int vsscanf(const char* s, const char* format, va_list arg); int fgetc(FILE* stream); char* fgets(char* s, int n, FILE* stream); int fputc(int c, FILE* stream); int fputs(const char* s, FILE* stream); int getc(FILE* stream); int getchar(); int putc(int c, FILE* stream); int putchar(int c); int puts(const char* s); int ungetc(int c, FILE* stream); size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream); size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream); int fgetpos(FILE* stream, fpos_t* pos); int fseek(FILE* stream, long int offset, int whence); int fsetpos(FILE* stream, const fpos_t* pos); long int ftell(FILE* stream); void rewind(FILE* stream); void clearerr(FILE* stream); int feof(FILE* stream); int ferror(FILE* stream); void perror(const char* s); }