std::cout, std::wcout
Aus cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <iostream>
|
||
extern std::ostream cout; |
(1) | |
extern std::wostream wcout; |
(2) | |
Die globale Objekte std::cout und std::wcout Steuerausgang zu einem Strom-Puffer der Umsetzung Typs (abgeleitet von std::streambuf), mit der Standard-C-Output-Stream verbundenen 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.
Diese Objekte sind garantiert gebaut, bevor die erste Konstruktor einer statischen Objekt aufgerufen werden, und sie werden garantiert, um die letzten Destruktor eines statischen Objekts überleben, so dass es immer möglich ist, um std::cout im User-Code zu schreiben .
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.
Sofern sync_with_stdio(false) ausgestellt wurde, ist es sicher den gleichzeitigen Zugriff auf diese Objekte aus mehreren Threads sowohl für formatierte und unformatierte Ausgabe .
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.
Einmal initialisiert, ist std::cout tie () 'd std::cin und std::wcout wird tie ()' d std::wcin, was bedeutet, dass jeder Eingang Betrieb auf std::cin std::cout.flush() führt (via std::basic_istream::sentry Konstruktor) .
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.
Einmal initialisiert std::cout wird auch binden () 'd std::cerr und std::wcout ist tie ()' d std::wcerr, bedeutet, dass jede Ausgabe-Operation am std::cerr std::cout.flush() führt (via std::basic_ostream::sentry Konstruktor) (seit 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) (seit 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.
[Bearbeiten] Beispiel
#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"; }
Output:
static constructor main function static destructor
[Bearbeiten] Siehe auch
}} initialisiert Standard-Stream-Objekten 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. (öffentlichen Member der Klasse of std::ios_base )
| |
schreibt der Standard-C-Fehler Stream stderr
(globales Objekt) Original: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
cout wcout |
schreibt in den Standard-C Ausgabe-Stream stdout (globales Objekt) |