What is stream iterator?- Iterators are the glue that hold the container and algorithms together. They provide an abstract view of data so that the writer of algorithm need not be concerned with concrete details of a myriad of data structures. At the same time, the standard model of data access provided by iterators relieves the containers from having to provide a more extensive set of access operations. - The iterators provided by Standard Library for stream I/O are known as stream iterators. The basic idea behind is simply to present input and output of collections as sequences. - For input and output there are different stream iterators provided: ostream_iterator : To write to an ostream. istream_iterator : To read from an istream. ostreambuf_iterator : To write to a stream buffer. istreambuf_iterator : To read from a stream buffer.
|