istreambuf_iterator::char_type

문자 형식에 제공 하는 형식에서 ostreambuf_iterator.

typedef CharType char_type;

설명

템플릿 매개 변수에 대 한 동의어입니다 CharType.

예제

// istreambuf_iterator_char_type.cpp
// compile with: /EHsc
#include <iterator>
#include <vector>
#include <iostream>
#include <algorithm>

int main( )
{
   using namespace std;

   typedef istreambuf_iterator<char>::char_type CHT1;
   typedef istreambuf_iterator<char>::traits_type CHTR1;

   cout << "(Try the example: 'So many dots to be done'\n"
        << " then an Enter key to insert into the output,\n"
        << " & use a ctrl-Z Enter key combination to exit): ";

   // istreambuf_iterator for input stream
   istreambuf_iterator< CHT1, CHTR1> charInBuf ( cin );
   ostreambuf_iterator<char> charOut ( cout );

   // Used in conjunction with replace_copy algorithm
   // to insert into output stream and replace spaces
   // with dot-separators
   replace_copy ( charInBuf , istreambuf_iterator<char>( ),
        charOut , ' ' , '.' );
}
  해야 할 많은 점
  해야 할 많은 점
(예제: '점선 대부분 하도록 해야 할' 다음에 Enter 키에 출력을 & 끝내려면 ctrl + Z Enter 키 조합 하 여 사용): So.many.dots.to.be.done 해야 할 많은 점 ^ Z

요구 사항

헤더: <iterator>

네임 스페이스: std

참고 항목

참조

istreambuf_iterator Class

표준 템플릿 라이브러리