std::ios_base::sync_with_stdio
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
static bool sync_with_stdio( bool sync = true ); |
||
Sets whether the standard std::cin, std::cout, std::cerr, std::clog, std::wcin, std::wcout, std::wcerr and std::wclog C++ streams are synchronized to the standard stdin, stdout, stderr and stdlog C streams after each input/output operation.
For a standard stream str
, synchronized with the C stream f
, the following pairs of functions have identical effect:
If the synchronization is turned off, the C++ standard streams are allowed to buffer their I/O independently, which may be considerably faster in some cases.
By default, all eight standard C++ streams are synchronized with their respective C streams.
It is implementation-defined if this function has any effect if called after some I/O occurred on the standard stream.
目次 |
[編集] パラメータ
sync | - | the new synchronization setting |
[編集] 値を返します
synchronization state before the call to the function
[編集] 例
#include <iostream> #include <cstdio> int main() { std::cout.sync_with_stdio(false); std::cout << "a\n"; std::printf("b\n"); std::cout << "c\n"; }
出力:
b a c
[編集] 参照
標準C出力ストリームstdout
(グローバルオブジェクト)に書き込みます Original: writes to the standard C output stream stdout (グローバルオブジェクト) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
標準Cのエラーストリームに書き込むstderr、unbuffered
(グローバルオブジェクト) Original: writes to the standard C error stream stderr, unbuffered (グローバルオブジェクト) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
標準Cエラーストリームstderr
(グローバルオブジェクト)に書き込みます Original: writes to the standard C error stream stderr (グローバルオブジェクト) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |