Namespace
Varianti

std::basic_istream::get

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

 
 
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_istream
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.
cin
wcin
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_istream::basic_istream
basic_istream::~basic_istream
basic_istream::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_istream::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_istream::get
basic_istream::peek
basic_istream::unget
basic_istream::putback
basic_istream::getline
basic_istream::ignore
basic_istream::read
basic_istream::readsome
basic_istream::gcount
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_istream::tellg
basic_istream::seekg
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_istream::sync
basic_istream::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_istream::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_istream)
 
int_type get();
(1)
basic_istream& get( char_type& ch );
(2)
basic_istream& get( char_type* s, std::streamsize count );
(3)
basic_istream& get( char_type* s, std::streamsize count, char_type delim );
(4)
basic_istream& get( basic_streambuf& strbuf );
(5)
basic_istream& get( basic_streambuf& strbuf, char_type delim );
(6)
Estrae carattere oi caratteri dal flusso di.
Original:
Extracts character or characters from stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tutte le versioni si comportano come UnformattedInputFunctions. Dopo la costruzione e la verifica dell'oggetto sentinella, queste funzioni eseguire le seguenti operazioni:
Original:
All versions behave as UnformattedInputFunctions. After constructing and checking the sentry object, these functions perform the following:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
legge un carattere e lo restituisce, se disponibile. In caso contrario, restituisce Traits::eof() e set failbit e eofbit.
Original:
reads one character and returns it if available. Otherwise, returns Traits::eof() and sets failbit and eofbit.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
legge un carattere e lo memorizza per ch se disponibile. In caso contrario, lascia ch non modificato e imposta failbit e eofbit. Si noti che questa funzione non sia in sovraccarico sui tipi signed char unsigned char e, a differenza del formattato >> operatore di inserimento dei caratteri.
Original:
reads one character and stores it to ch if available. Otherwise, leaves ch unmodified and sets failbit and eofbit. Note that this function is not overloaded on the types signed char and unsigned char, unlike the formatted character input operator>>.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
stessa get(s, count, widen('\n')), cioè, legge a caratteri più count-1 e li memorizza nella stringa di caratteri puntato da s fino '\n' si trova.
Original:
same as get(s, count, widen('\n')), that is, reads at most count-1 characters and stores them into character string pointed to by s until '\n' is found.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
legge caratteri e li memorizza nelle posizioni successive della matrice di caratteri il cui primo elemento è puntato da s. I caratteri vengono estratte e memorizzate fino a una delle seguenti condizioni:
Original:
reads characters and stores them into the successive locations of the character array whose first element is pointed to by s. Characters are extracted and stored until any of the following occurs:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • n-1 caratteri sono stati memorizzati
    Original:
    n-1 characters have been stored
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • condizione di fine file avviene nella sequenza di input (setstate(eofbit) si chiama)
    Original:
    end of file condition occurs in the input sequence (setstate(eofbit) is called)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • il successivo carattere di input disponibili c pari delim, come determinato da Traits::eq(c, delim). Questo carattere non è estratto (a differenza basic_istream::getline())
    Original:
    the next available input character c equals delim, as determined by Traits::eq(c, delim). This character is not extracted (unlike basic_istream::getline())
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Se non sono stati estratti i caratteri, le chiamate setstate(failbit). In ogni caso, se count>0, un carattere nullo (CharT() è memorizzato nella prima posizione successiva della matrice.
Original:
If no characters were extracted, calls setstate(failbit). In any case, if count>0, a null character (CharT() is stored in the next successive location of the array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
get(strbuf, widen('\n')) stessa, che è, legge i caratteri disponibili e li inserisce all'oggetto basic_streambuf dato fino '\n' si trova..
Original:
same as get(strbuf, widen('\n')), that is, reads available characters and inserts them to the given basic_streambuf object until '\n' is found.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
6)
legge caratteri e li inserisce la sequenza di uscita controllata dall'oggetto basic_streambuf dato caratteri vengono estratti e inseriti in strbuf fino a quando una delle seguenti condizioni:.
Original:
reads characters and inserts them to the output sequence controlled by the given basic_streambuf object. Characters are extracted and inserted into strbuf until any of the following occurs:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • condizione di fine file avviene nella sequenza di input
    Original:
    end of file condition occurs in the input sequence
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • inserire nel... sequenza di emissione fallisce (nel qual caso il carattere che non può essere inserito, non viene estratto)
    Original:
    insert into the output sequence fails (in which case the character that could not be inserted, is not extracted)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • il carattere successivo ingresso disponibile c uguale delim, come determinato da Traits::eq(c, delim). Questo carattere non è estratto.
    Original:
    the next available input character c equals delim, as determined by Traits::eq(c, delim). This character is not extracted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • verifica un'eccezione (in qual caso l'eccezione viene catturato e non rilanciata)
    Original:
    an exception occurs (in which case the exception is caught and not rethrown)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Se non sono stati estratti i caratteri, le chiamate setstate(failbit).
Original:
If no characters were extracted, calls setstate(failbit).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tutte le versioni impostare il valore della gcount() al numero di caratteri estratti.
Original:
All versions set the value of gcount() to the number of characters extracted.
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 -
riferimento al carattere di scrivere il risultato
Original:
reference to the character to write the result to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
s -
puntatore alla stringa di caratteri per memorizzare i caratteri
Original:
pointer to the character string to store the characters to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
count -
dimensione della stringa di caratteri a cui punta s
Original:
size of character string pointed to by s
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
delim -
delimitando carattere per fermare l'estrazione a. Non è estratto e non memorizzati .
Original:
delimiting character to stop the extraction at. It is not extracted and not stored.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strbuf -
buffer di flusso per leggere il contenuto
Original:
stream buffer to read the content to
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

1)
il carattere estratto o Traits::eof()
Original:
the extracted character or Traits::eof()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

2-6) *this

[modifica] Esempio

#include <sstream>
#include <iostream>
int main()
{
    std::istringstream s1("Hello, world.");
    char c1 = s1.get(); // reads 'H'
    std::cout << "after reading " << c1 << ", gcount() == " <<  s1.gcount() << '\n';
    char c2;
    s1.get(c2);         // reads 'e'
    char str[5];
    s1.get(str, 5);     // reads "llo,"
    std::cout << "after reading " << str << ", gcount() == " <<  s1.gcount() << '\n';
    std::cout << c1 << c2 << str;
    s1.get(*std::cout.rdbuf()); // reads the rest, not including '\n'
    std::cout << "\nAfter the last get(), gcount() == " << s1.gcount() << '\n';
}

Output:

after reading H, gcount() == 1
after reading llo,, gcount() == 4
Hello, world.
After the last get(), gcount() == 7

[modifica] Vedi anche

estrae blocchi di caratteri
Original:
extracts 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.

(membro pubblico funzione) [edit]
estratti i dati formattati
Original:
extracts formatted data
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(membro pubblico funzione) [edit]
estrae i caratteri e array di caratteri
Original:
extracts characters and character arrays
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione di modello) [edit]