標準庫標頭檔案 <cstdio>
來自 cppreference.com
此標頭檔案最初是 C 標準庫的一部分,命名為 <stdio.h>。
此標頭檔案是 C 風格輸入/輸出庫的一部分。
型別 | ||
物件型別,能夠儲存控制 C I/O 流所需的所有資訊 (typedef) | ||
完整的非陣列物件型別,能夠唯一指定檔案中的位置,包括其多位元組解析狀態 (typedef) | ||
由 sizeof 運算子返回的無符號整型 (typedef) | ||
宏 | ||
實現定義的空指標常量 (宏常量) | ||
與輸入流關聯的 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_SETSEEK_CURSEEK_END |
std::fseek 的引數,指示從檔案開頭查詢 std::fseek 的引數,指示從當前檔案位置查詢 std::fseek 的引數,指示從檔案末尾查詢 (宏常量) | |
TMP_MAX |
由 std::tmpnam 生成的最大唯一檔名數 (宏常量) | |
L_tmpnam |
容納 std::tmpnam 結果所需的 char 陣列大小 (宏常量) | |
函式 | ||
檔案訪問 | ||
開啟檔案 (函式) | ||
用不同的名稱開啟一個現有流 (函式) | ||
關閉檔案 (函式) | ||
將輸出流與實際檔案同步 (函式) | ||
為檔案流設定緩衝區 (函式) | ||
為檔案流設定緩衝區及其大小 (函式) | ||
直接輸入/輸出 | ||
從檔案讀取 (函式) | ||
寫入檔案 (函式) | ||
非格式化輸入/輸出 | ||
窄字元 | ||
從檔案流中獲取一個字元 (函式) | ||
從檔案流獲取字元字串 (函式) | ||
向檔案流寫入一個字元 (函式) | ||
將字元字串寫入檔案流 (函式) | ||
從 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 = /* see description */; using FILE = /* see description */; using fpos_t = /* see description */; } #define NULL /* see description */ #define _IOFBF /* see description */ #define _IOLBF /* see description */ #define _IONBF /* see description */ #define BUFSIZ /* see description */ #define EOF /* see description */ #define FOPEN_MAX /* see description */ #define FILENAME_MAX /* see description */ #define L_tmpnam /* see description */ #define SEEK_CUR /* see description */ #define SEEK_END /* see description */ #define SEEK_SET /* see description */ #define TMP_MAX /* see description */ #define stderr /* see description */ #define stdin /* see description */ #define stdout /* see description */ 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); }