std::cout, std::wcout
提供: cppreference.com
|
|
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
| ヘッダ <iostream> で定義
|
||
| extern std::ostream cout; |
(1) | |
| extern std::wostream wcout; |
(2) | |
グローバルオブジェクトstd::cout、標準C出力ストリームに関連付けられている実装定義型(std::wcout由来)のストリームバッファへstd::streambuf制御出力stdout.
Original:
The global objects std::cout and std::wcout control output to a stream buffer of implementation-defined type (derived from std::streambuf), associated with 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.
You can help to correct and verify the translation. Click here for instructions.
これらのオブジェクトは、静的オブジェクトの最初のコンストラクタが呼び出される前に建設されることが保証されて、彼らは、それがユーザーコードでstd::coutに書き込みすることは常に可能であるように、静的オブジェクトの最後のデストラクタよりも長生きすることが保証されています.
Original:
These objects are guaranteed to be constructed before the first constructor of a static object is called and they are guaranteed to outlive the last destructor of a static object, so that it is always possible to write to std::cout in user code.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
sync_with_stdio(false)が発行されていない限り、それは同時にフォーマットし、フォーマットされていない出力の両方に複数のスレッドからこれらのオブジェクトにアクセスしても安全です.
Original:
Unless sync_with_stdio(false) has been issued, it is safe to concurrently access these objects from multiple threads for both formatted and unformatted output.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
いったん初期化されると、std::coutはタイです() 'dにstd::cinとstd::wcoutのtie()である'std::wcinのd、std::cin上の任意の入力操作(std::cout.flush()のコンストラクタ経由)std::basic_istream::sentryを実行することを意味.
Original:
Once initialized, std::cout is tie()'d to std::cin and std::wcout is tie()'d to std::wcin, meaning that any input operation on std::cin executes std::cout.flush() (via std::basic_istream::sentry's constructor).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
いったん初期化されると、std::coutも)(TIEさ 'dにstd::cerrとstd::wcoutあるのtie()' dにstd::wcerr、std::cerr上の任意の出力操作はstd::cout.flush()(std::basic_ostream::sentryのコンストラクタ経由)(C++11およびそれ以降)を実行することを意味している
Original:
Once initialized, std::cout is also tie()'d to std::cerr and std::wcout is tie()'d to std::wcerr,, meaning that any output operation on std::cerr executes std::cout.flush() (via std::basic_ostream::sentry's constructor) (C++11およびそれ以降)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
Run this code
#include <iostream> struct Foo { int n; Foo() { std::cout << "static constructor\n"; } ~Foo() { std::cout << "static destructor\n"; } }; Foo f; // static object int main() { std::cout << "main function\n"; }
出力:
static constructor main function static destructor
[編集] 参照
| 標準ストリームオブジェクトを初期化します Original: initializes standard stream objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. ( std::ios_baseのpublicメンバクラス)
| |
| 標準 C エラーストリーム stderr に書き込みます (global object) | |
| coutwcout |
標準 C 出力ストリーム stdout に書き込みます (global object) |