std::cout, std::wcout
Da 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. |
Definido no cabeçalho <iostream>
|
||
extern std::ostream cout; |
(1) | |
extern std::wostream wcout; |
(2) | |
Os objectos globais std::cout e std::wcout saída de controle de fluxo de um tampão de aplicação (tipo definido derivado de std::streambuf), associado com o padrão de fluxo de saída 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.
Esses objetos são garantidos para ser construído antes de o primeiro construtor de um objeto estático é chamado e eles são garantidos para sobreviver à última destruidor de um objeto estático, de modo que é sempre possível escrever para std::cout no código do usuário.
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) foi emitido, ele é seguro para acessar simultaneamente esses objetos de vários segmentos, tanto para saída formatada e não formatado.
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.
Uma vez inicializado, é std::cout empate () 'd para std::cin e std::wcout é laço ()' d para std::wcin, o que significa que qualquer operação de entrada em std::cin executa std::cout.flush() (via construtor de 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.
Uma vez inicializado, std::cout também é amarrar () 'd para std::cerr e std::wcout é laço ()' d para std::wcerr, o que significa que qualquer operação de saída em std::cerr executa std::cout.flush() (via construtor de std::basic_ostream::sentry) (desde 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) (desde 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] Exemplo
Saída:
static constructor main function static destructor
[editar] Veja também
inicializa objetos de fluxo padrão 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. (of std::ios_base public class membro)
| |
escreve para o padrão stderr
(objeto global) fluxo de erro C 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 |
grava o padrão de fluxo de saída stdout
(objeto global) C 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. |