std::cout, std::wcout
De 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. |
| Defined in header <iostream>
|
||
| extern std::ostream cout; |
(1) | |
| extern std::wostream wcout; |
(2) | |
Los objetos globales std::cout y std::wcout salida de control a un búfer de la secuencia de aplicación definido por el tipo (derivado de std::streambuf), asociada con el flujo de salida estándar C 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.
Estos objetos están garantizados para ser construido antes de la primera constructor de un objeto estático se llama y que están garantizados para sobrevivir a la última destructor de un objeto estático, por lo que siempre es posible escribir en std::cout en código de usuario .
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.
A menos que sync_with_stdio(false) se ha emitido, se puede acceder a estos objetos simultáneamente desde varios subprocesos, tanto para la salida con formato y sin formato .
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.
Una vez inicializado, std::cout es lazo () 'd a std::cin y se std::wcout lazo ()' d a std::wcin, lo que significa que cualquier operación de entrada en std::cin ejecuta std::cout.flush() (a través del constructor 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.
Una vez inicializado, std::cout también se atan () 'd a std::cerr y std::wcout es lazo ()' d a std::wcerr,, lo que significa que cualquier operación de salida en std::cerr ejecuta std::cout.flush() (a través del constructor std::basic_ostream::sentry) (ya que 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) (ya que 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.
[editar] Ejemplo
Output:
static constructor main function static destructor
[editar] Ver también
| inicializa los objetos estándar de la corriente 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. (miembro público of std::ios_base clase)
| |
| escribe en el stderr
(objeto global) corriente estándar de C error Original: writes to the standard C error stream stderr (objeto global) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| cout wcout |
escribe en el stdout
(objeto global) corriente estándar C de salida Original: writes to the standard C output stream stdout (objeto global) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |