std::cout, std::wcout
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <iostream>
|
||
extern std::ostream cout; |
(1) | |
extern std::wostream wcout; |
(2) | |
Gli oggetti globali std::cout e std::wcout uscita di controllo ad un buffer del flusso di attuazione tipo definito (derivato da std::streambuf), associata allo standard output stream 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.
Questi oggetti sono garantiti per essere costruito prima del primo costruttore di un oggetto statico viene chiamato e sono garantiti per sopravvivere distruttore ultimo di un oggetto statico, in modo che sia sempre possibile scrivere std::cout nel codice utente.
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 meno che sync_with_stdio(false) è stato rilasciato, è sicuro per accedere a questi oggetti contemporaneamente da più thread sia per l'output formattato e non formattati.
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 volta inizializzato, std::cout è pareggio () 'd per std::cin e std::wcout è cravatta ()' d per std::wcin, il che significa che ogni operazione di ingresso std::cin esegue std::cout.flush() (tramite il costruttore di 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 volta inizializzato, std::cout è anche legare () 'd per std::cerr e std::wcout è pareggio ()' d per std::wcerr,, il che significa che qualsiasi operazione di uscita sul std::cerr esegue std::cout.flush() (tramite il costruttore di std::basic_ostream::sentry) (dal 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) (dal 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.
[modifica] Esempio
Output:
static constructor main function static destructor
[modifica] Vedi anche
inizializza oggetti stream standard 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. (membro pubblico of std::ios_base classe)
| |
scrive allo standard stderr
(oggetto globale) flusso di errore C 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 |
scrive nel flusso di output standard di stdout
(oggetto globale) C Original: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |