標準ライブラリヘッダ <cstdio>
提供: cppreference.com
このヘッダは元々 C 標準ライブラリに <stdio.h> として存在していました。
このヘッダは C スタイルの入出力ライブラリの一部です。
目次 |
[編集] 型
| FILE | C の入出力ストリームを制御するために必要なすべての情報を保持できる型 |
| fpos_t | ファイルの位置を唯一に特定できる型 |
| sizeof 演算子によって返される符号なし整数型 (typedef) |
[編集] マクロ
| 処理系定義のヌルポインタ定数 (マクロ定数) | |
| stdinstdoutstderr |
入力ストリームに関連付けられた FILE* 型の式 出力ストリームに関連付けられた FILE* 型の式 エラー出力ストリームに関連付けられた FILE* 型の式 (マクロ定数) |
| EOF |
負の値を持つ int 型の整数定数式 (マクロ定数) |
| FOPEN_MAX |
同時にオープンできるファイルの最大数 (マクロ定数) |
| FILENAME_MAX |
サポートされている最も長いファイル名を保持するために必要な char 配列のサイズ (マクロ定数) |
| BUFSIZ |
std::setbuf で使用するバッファのサイズ (マクロ定数) |
| _IOFBF_IOLBF_IONBF |
完全バッファリングを表す std::setbuf に渡す引数 行バッファリングを表す std::setbuf に渡す引数 バッファリングなしを表す std::setbuf に渡す引数 (マクロ定数) |
| 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 に出力します (関数) | |
ファイルに対する操作 | |
| ファイルを消去します (関数) | |
| ファイルの名前を変更します (関数) | |
| 自動的に削除される一時的なファイルを開きます (関数) | |
| 一意なファイル名を返します (関数) | |
[編集] ノート
- NULL は以下のヘッダでも定義されています。
- std::size_t は以下のヘッダでも定義されています。
[編集] 概要
namespace std { using size_t = /* see definition */; using FILE = /* see definition */ ; using fpos_t = /* see definition */ ; } #define NULL /* see definition */ #define _IOFBF /* see definition */ #define _IOLBF /* see definition */ #define _IONBF /* see definition */ #define BUFSIZ /* see definition */ #define EOF /* see definition */ #define FOPEN_MAX /* see definition */ #define FILENAME_MAX /* see definition */ #define L_tmpnam /* see definition */ #define SEEK_CUR /* see definition */ #define SEEK_END /* see definition */ #define SEEK_SET /* see definition */ #define TMP_MAX /* see definition */ #define stderr /* see definition */ #define stdin /* see definition */ #define stdout /* see definition */ namespace std { int remove(const char* filename); int rename(const char* old, const char* new); 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); }

