istreambuf_iterator::operator*
The dereferencing operator returns the next character in the stream.
CharType operator*( ) const;
반환 값
The next character in the stream.
예제
// 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-7fc9d613606c4e2d84bca8e2595f8d32-472f7dd4b6a849fc80ca9c0e8ebdb69e
요구 사항
헤더: <iterator>
네임스페이스: std