Condividi tramite


istreambuf_iterator::operator*

L'operatore dereferenziante 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. 

FakePre-8171a6928fbe4d1ebb78448fc162bf05-6c240c8d4bc644008e766f798c17117b

Requisiti

Intestazione: <iteratore>

Spazio dei nomi: std

Vedere anche

Riferimenti

Classe istreambuf_iterator

Libreria di modelli standard