ostream_iterator::char_type

A type that provides for the character type of the iterator.

typedef CharType char_type;

Remarks

The type is a synonym for the template parameter CharType.

Example

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

int main( )
{
   using namespace std;

   typedef ostream_iterator<int>::char_type CHT1;
   typedef ostream_iterator<int>::traits_type CHTR1;

   // ostream_iterator for stream cout
   // with new line delimiter:
    ostream_iterator<int, CHT1, CHTR1> intOut ( cout , "\n" );

   // Standard iterator interface for writing
   // elements to the output stream:
   cout << "The integers written to the output stream\n"
        << "by intOut are:" << endl;
   *intOut = 10;
   *intOut = 20;
   *intOut = 30;
}
The integers written to the output stream
by intOut are:
10
20
30

Requirements

Header: <iterator>

Namespace: std

See Also

Reference

ostream_iterator Class

Standard Template Library

Other Resources

ostream_iterator Members