Namespace
Varianti

std::basic_ostream::put

Da cppreference.com.
< cpp‎ | io‎ | basic ostream

 
 
Ingresso / libreria di output
I / O manipolatori
C-style I / O
Buffer
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(deprecato)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Astrazioni
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
File I / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
String I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Array I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(deprecato)
ostrstream(deprecato)
strstream(deprecato)
Tipi
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Errore categoria interfaccia
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
std::basic_ostream
Gli oggetti globali
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Membri funzioni
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::basic_ostream
basic_ostream::~basic_ostream
basic_ostream::operator=(C++11)
Ingresso formattato
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::operator<<
Ingresso non formattato
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::put
basic_ostream::write
Posizionamento
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::tellp
basic_ostream::seekp
Varie
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::flush
basic_ostream::swap(C++11)
Membri classi
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::sentry
Non membri funzioni
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator<<(std::basic_ostream)
 
basic_ostream& put( char_type ch );
Scrive ch carattere nel flusso di output.
Original:
Writes character ch to the output stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Questa funzione è una funzione di output non formattato: è avviare l'esecuzione con la costruzione di un oggetto di tipo 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)
Original:
This function is an unformatted output function: it begin execution by constructing an object of type 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)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica] Parametri

ch -
carattere da scrivere
Original:
character to write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Valore di ritorno

*this

[modifica] Note

formattato
Original:
This function is not overloaded for the types signed char or unsigned char, unlike the formatted
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
A differenza delle funzioni di output formattato, questa funzione non viene impostato il failbit se l'uscita non riesce.
Original:
Unlike formatted output functions, this function does not set the failbit if the output fails.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Esempio

#include <fstream>
#include <iostream>
int main()
{
    std::cout.put('a'); // normal usage
    std::cout.put('\n');
 
    std::ofstream s("/does/not/exist/");
    s.clear(); // pretend the stream is good
    std::cout << "Unformatted output: ";
    s.put('c'); // this will set badbit, but not failbit
    std::cout << " fail=" << bool(s.rdstate() & s.failbit);
    std::cout << " bad=" << s.bad() << '\n';
    s.clear();
    std::cout << "Formatted output:   ";
    s << 'c'; // this will set badbit and failbit
    std::cout << " fail=" << bool(s.rdstate() & s.failbit);
    std::cout << " bad=" << s.bad() << '\n';
}

Output:

a
Unformatted output:  fail=0 bad=1
Formatted output:    fail=1 bad=1

[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) [modifica]
blocchi inserti di caratteri
Original:
inserts blocks of characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico) [modifica]