istreambuf_iterator::operator*
L'operatore derefenziante restituisce il carattere successivo nel flusso.
CharType operator*( ) const;
Valore restituito
Il carattere successivo nel flusso.
Esempio
// istreambuf_iterator_operator_deref.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream>
int main( )
{
using namespace std;
cout << "Type string of characters & enter to output it,\n"
<< " with stream buffer iterators,(try: 'I'll be back.')\n"
<< " repeat as many times as desired,\n"
<< " then keystroke ctrl-Z Enter to exit program: ";
istreambuf_iterator<char> inpos ( cin );
istreambuf_iterator<char> endpos;
ostreambuf_iterator<char> outpos ( cout );
while ( inpos != endpos )
{
*outpos = *inpos; //Put value of outpos equal to inpos
++inpos;
++outpos;
}
}
sarò indietro.
sarò indietro. Digitare la stringa di caratteri e immettere per ripristinare, con gli iteratori del buffer del flusso, (provare: “Sarò riquadro. ") che tutte le volte che si desidera, la sequenza di tasti CTRL alla z passa al programma di output: sarò indietro. Sarò indietro. ^Z
Requisiti
intestazione: <iterator>
Spazio dei nomi: deviazione standard