<cstdio>ヘッダ †
<cstdio>ヘッダは、入出力のための関数の宣言、および関連する型とマクロの定義を行う。
マクロ †
NULL †
空ポインタ定数
解説
処理系定義の空ポインタ定数を表すマクロ。0 や 0L に定義される可能性はあるが、(void*)0 に定義されることはない。
参考
NULL マクロは、<cstdio>ヘッダ以外に、<cstddef>ヘッダ、<clocale>ヘッダ、<cstdlib>ヘッダ、<cstring>ヘッダ、<ctime>ヘッダ、および<cwchar>ヘッダでも定義される。
EOF †
ファイルの終わり
FILENAME_MAX †
ファイル名の最大長
解説
オープンすることができることを処理系が保証する最大の文字列長 (末尾のナル文字を含む) を表す汎整数定数式?に展開されるマクロ。ファイル名の長さに制限がないような環境では、推奨する文字列長の最大値に定義されることが望ましいとされている。
FOPEN_MAX †
同時にオープンすることができることを処理系が保証する最大のファイル数を表す汎整数定数式?に展開されるマクロ。少なくとも 8 以上の値に定義される。
TMP_MAX †
tmpnam 関数が生成することができる一時ファイル名の最大数。生成される一意のファイル名について、処理系が保証する最大の数を表す汎整数定数式に展開される。TMP_MAX は少なくとも 25 以上の値に定義される。
L_tmpnam †
SEEK_SET †
SEEK_CUR †
SEEK_END †
_IONBF †
バッファリングなし
_IOLBF †
行バッファリング
_IOFBF †
フルバッファリング
BUFSIZ †
stdin †
標準入力ストリーム
形式
extern FILE* stdin;
stdout †
標準出力ストリーム
形式
extern FILE* stdout;
stderr †
標準エラー出力ストリーム
形式
extern FILE* stderr;
型 †
size_t †
サイズの型
解説
sizeof 演算子?の結果の型。処理系定義の符号なし整数型に定義される。
参考
size_t 型は、<cstdio>ヘッダ以外に、<cstddef>ヘッダ、<cstdlib>ヘッダ、<cstring>ヘッダ、<ctime>ヘッダ、および<cwchar>ヘッダでも定義される。
FILE †
ファイル記述子型
解説
FILE 型は、ファイル位置表示子?、(もし存在するなら) 結び付けられたバッファを指すポインタ、エラー表示子?、およびファイル終端表示子?など、ファイルの制御に必要な情報を格納することができるオブジェクト型である。
fpos_t †
ファイル位置型
解説
fpos_t 型は、ファイルの任意の位置を表すためのすべての情報を格納することができるオブジェクト型である。ただし、配列型ではない。
関数 †
fopen †
形式
namespace std {
FILE* fopen(const char* filename, const char* mode);
}
freopen †
形式
namespace std {
FILE* freopen(const char* filename, const char* mode, FILE* stream);
}
fclose †
形式
namespace std {
int fclose(FILE* stream);
}
clearerr †
形式
namespace std {
void clearerr(FILE* stream);
}
feof †
形式
namespace std {
int feof(FILE* stream);
}
ferror †
形式
namespace std {
int ferror(FILE* stream);
}
fread †
形式
namespace std {
size_t fread(void* ptr, size_t size, size_t n, FILE* stream);
}
fwrite †
形式
namespace std {
size_t fwrite(const void* ptr, size_t size, size_t n, FILE* stream);
}
ftell †
形式
namespace std {
long ftell(FILE* stream);
}
fseek †
形式
namespace std {
int fseek(FILE* stream, long offset, int origin);
}
rewind †
形式
namespace std {
void rewind(FILE* stream);
}
fgetpos †
形式
namespace std {
int fgetpos(FILE* stream, fpos_t* pos);
}
fsetpos †
形式
namespace std {
int fsetpos(FILE* stream, const fpos_t* pos);
}
fgetc †
形式
namespace std {
int fgetc(FILE* stream);
}
getc †
形式
namespace std {
int getc(FILE* stream);
}
getchar †
形式
namespace std {
int getchar();
}
fputc †
形式
namespace std {
int fputc(int c, FILE* stream);
}
putc †
形式
namespace std {
int putc(int c, FILE* stream);
}
putchar †
形式
namespace std {
int putchar(int c);
}
ungetc †
形式
namespace std {
int ungetc(int c, FILE* stream);
}
fgets †
形式
namespace std {
char* fgets(char* c, FILE* stream);
}
gets †
形式
namespace std {
char* gets(char* c);
}
fputs †
形式
namespace std {
int fputs(const char* c, FILE* stream);
}
puts †
形式
namespace std {
int puts(const char* c);
}
setbuf †
形式
namespace std {
void setbuf(FILE* stream, char* buf);
}
setvbuf †
形式
namespace std {
int setvbuf(FILE* stream, char* buf, int mode, size_t size);
}
fflush †
形式
namespace std {
int fflush(FILE* stream);
}
scanf †
形式
namespace std {
int scanf(const char* format ...);
}
fscanf †
形式
namespace std {
int fscanf(FILE* stream, const char* format ...);
}
sscanf †
形式
namespace std {
int sscanf(const char* s, const char* format ...);
}
printf †
形式
namespace std {
int printf(const char* format ...);
}
fprintf †
形式
namespace std {
int fprintf(FILE* stream, const char* format ...);
}
sprintf †
形式
namespace std {
int sprintf(char* s, const char* format ...);
}
vprintf †
形式
namespace std {
int vprintf(const char* format, va_list arg);
}
vfprintf †
形式
namespace std {
int fprintf(FILE* stream, const char* format, va_list arg);
}
vsprintf †
形式
namespace std {
int sprintf(char* s, const char* format, va_list arg);
}
printf †
形式
namespace std {
int printf(const char* format ...);
}
fprintf †
形式
namespace std {
int fprintf(FILE* stream, const char* format ...);
}
tmpnam †
形式
namespace std {
char* tmpnam(char* s);
}
tmpfile †
形式
namespace std {
FILE* tmpfile();
}
remove †
ファイルの削除
形式
namespace std {
int remove(const char* filename);
}
引数
filename: ファイル名
返却値
操作が成功した場合は 0 を、失敗した場合は 0 以外を返す。
解説
filename で指定されたファイルをアクセスできないようにする。remove 関数の呼び出しによってアクセスできなくファイルは、同じ名前のファイルを再度生成しない限り、オープンすることができない。オープンされているファイルに対して remove 関数を呼び出した場合の動作は処理系定義である。
rename †
形式
namespace std {
int rename(const char* oldname, const char* newname);
}
参照 †
Last-modified: Thu, 15 Dec 2005 15:07:06 JST (5522d)