Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The dereferencing operator returns the next character in the stream.
CharType operator*( ) const;
Return Value
The next character in the stream.
Example
// 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;
}
}
I'll be back.
FakePre-c44af9c0a85643b69895f8ad114be658-0c6cee317b6142ddb3dd72aa42809888
Requirements
Header: <iterator>
Namespace: std