std::cin, std::wcin
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::istream cin; |
(1) | |
extern std::wistream wcin; |
(2) | |
Gli oggetti globali std::cin e controllo di input std::wcin da un buffer flusso di attuazione tipo definito (derivato da std::streambuf), associata allo standard input stream C stdin.
Original:
The global objects std::cin and std::wcin control input from a stream buffer of implementation-defined type (derived from std::streambuf), associated with the standard C input stream stdin.
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 leggere da std::cin 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 read from std::cin 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'input formattato e non formattato.
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 input.
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 che si costruisce, std::cin std::cin.tie() torna &std::cout, e similmente, std::wcin.tie() ritorna &std::wcout. Ciò significa che qualsiasi operazione di input formattato std::cin costringe una chiamata a std::cout.flush() se i caratteri sono in attesa per l'uscita.
Original:
Once std::cin is constructed, std::cin.tie() returns &std::cout, and likewise, std::wcin.tie() returns &std::wcout. This means that any formatted input operation on std::cin forces a call to std::cout.flush() if any characters are pending for 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.
[modifica] Esempio
Output:
Enter n: 10 f.n is 10
[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 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. |