Use istream_iterator : Stream iterator « File « C++






Use istream_iterator

Use istream_iterator


#include <iostream>
#include <iterator>
using namespace std;

int main()
{
  istream_iterator<char> in_it(cin);

  do {
    cout << *in_it++;
  } while (*in_it != '.'); 

  return 0;
}

           
       








Related examples in the same category

1.Use ostream_iteratorUse ostream_iterator