istreambuf_iterator::operator*

역참조 연산자는 스트림에서 다음 문자를 반환 합니다.

CharType operator*( ) const;

반환 값

스트림의 다음 문자입니다.

예제

// 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.
입력 문자열의 문자 & 스트림 버퍼 반복기와 출력을 입력 (try: '제가 백. 드리겠습니다')에 따라 여러 번 원하는 대로 다음 프로그램을 끝내려면 ctrl + Z Enter를 키 입력 반복: 다시 드리겠습니다. 다시 수 있습니다. ^ Z

요구 사항

헤더: <iterator>

네임 스페이스: std

참고 항목

참조

istreambuf_iterator Class

표준 템플릿 라이브러리