std::basic_ostream::write
![]() | 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. |
basic_ostream& write(const char_type* s, std::streamsize count ); | ||
Outputs characters from successive locations in the character array whose first element is pointed to by s
. Characters are inserted into the output sequence until one of the following occurs:
- exactly
count
characters are inserted - inserting into the output sequence fails (in which case setstate(badbit) is called)
sentry
, che svuota il buffer di uscita tie()'d, se necessario, e controlla gli errori del flusso. Dopo la costruzione, se i rendimenti sentinella oggetto false, la funzione restituisce senza tentare alcun output. Se viene generata un'eccezione durante l'uscita, poi ios :: badbit è impostato (l'eccezione è soppressa a meno exceptions()&badbit !=0, nel qual caso viene rilanciata)sentry
, which flushes the tie()'d output buffers if necessary and checks the stream errors. After construction, if the sentry object returns false, the function returns without attempting any output. If an exception is thrown during output, then ios::badbit is set (the exception is suppressed unless exceptions()&badbit !=0, in which case it is rethrown)You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica]Parametri
s | - | pointer to the character string to write |
count | - | number of characters to write |
[modifica]Valore di ritorno
*this
[modifica]Note
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click here for instructions.
Also, unlike the formatted output functions, this function does not set the failbit
on failure.
[modifica]Eccezioni
If an exception occurs during output and exceptions()&badbit !=0, rethrows that exception.
If output fails and exceptions()&badbit !=0, throws ios_base::failure.
[modifica]Esempio
This function may be used to output object representations, i.e. binary output
Output:
DCBA
[modifica]Vedi anche
inserisce i dati carattere Original: inserts character data The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
inserisce un carattere Original: inserts a character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |