File tree Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 21
21
| [ ` _IOFBF ` ] ( /reference/cstdio/iofbf.md.nolink ) | 入出力を完全にバッファリングする指定のための整数定数 | |
22
22
| [ ` _IOLBF ` ] ( /reference/cstdio/iolbf.md.nolink ) | 入出力を行バッファリングする指定のための整数定数 | |
23
23
| [ ` _IONBF ` ] ( /reference/cstdio/ionbf.md.nolink ) | 入出力をバッファリングしない指定のための整数定数 | |
24
- | [ ` BUFSIZ ` ] ( /reference/cstdio/bufsiz.md.nolink ) | バッファサイズを表す整数定数 | |
24
+ | [ ` BUFSIZ ` ] ( /reference/cstdio/bufsiz.md ) | バッファサイズを表す整数定数 | |
25
25
| [ ` EOF ` ] ( /reference/cstdio/eof.md ) | ファイルの終端であることを表す` int ` 型の整数定数 | |
26
26
| [ ` FOPEN_MAX ` ] ( /reference/cstdio/fopen_max.md.nolink ) | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | |
27
27
| [ ` FILENAME_MAX ` ] ( /reference/cstdio/filename_max.md ) | 実装によって保証されるファイル名の最大の長さを表す整数定数 | |
Original file line number Diff line number Diff line change
1
+ # BUFSIZ
2
+ * cstdio[ meta header]
3
+ * macro[ meta id-type]
4
+
5
+ ``` cpp
6
+ #define BUFSIZ unspecified
7
+ ```
8
+ * unspecified[italic]
9
+
10
+ ## 概要
11
+ [`setbuf()`](/reference/cstdio/setbuf.md.nolink)関数で使われる標準入出力のバッファサイズを表すマクロ。
12
+
13
+ このマクロは、標準入出力関数で使用されるデフォルトのバッファサイズを定義する。値は実装依存であるが、一般的には512バイトや1024バイトなどの値が使用される。
14
+
15
+ ## 例
16
+ ```cpp example
17
+ #include <cstdio>
18
+
19
+ int main() {
20
+ // BUFSIZの値を表示
21
+ std::printf("BUFSIZ = %d\n", BUFSIZ);
22
+
23
+ // バッファサイズを指定してファイルを開く
24
+ char buffer[BUFSIZ];
25
+ std::FILE* file = std::fopen("test.txt", "w");
26
+ if (file) {
27
+ // バッファを設定
28
+ std::setbuf(file, buffer);
29
+ std::fprintf(file, "Hello, World!\n");
30
+ std::fclose(file);
31
+ }
32
+
33
+ return 0;
34
+ }
35
+ ```
36
+ * BUFSIZ[color ff0000]
37
+ * std::printf[link /reference/cstdio/printf.md]
38
+ * std::fopen[link /reference/cstdio/fopen.md]
39
+ * std::setbuf[link /reference/cstdio/setbuf.md.nolink]
40
+ * std::fprintf[link /reference/cstdio/fprintf.md]
41
+ * std::fclose[link /reference/cstdio/fclose.md]
42
+
43
+ ### 出力例
44
+ ```
45
+ BUFSIZ = 1024
46
+ ```
47
+
48
+ ## 処理系
49
+
50
+ - [Clang](/implementation.md#clang): ??
51
+ - [GCC](/implementation.md#gcc): ??
52
+ - [Visual C++](/implementation.md#visual_cpp): ??
You can’t perform that action at this time.
0 commit comments