istreambuf_iterator::operator*
Der Dereferenzierungsoperator gibt dem folgenden Zeichen im Stream zurück.
CharType operator*( ) const;
Rückgabewert
Das nächste Zeichen im Stream.
Beispiel
// 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;
}
}
Ich bin nach.
FakePre-1275cde0d58847d9bf4abb951796d9a0-6c0738ed60b0405db6148fcf87423a47
Anforderungen
Header: <Iterator>
Namespace: std