topical media & game development

talk show tell print

professional-program-23-IteratorAdapters-StreamIterators.c

? / professional-program-23-IteratorAdapters-StreamIterators.c


  include <algorithm>
  include <iostream>
  include <iterator>
  include <vector>
  using namespace std;
  
  int main(int argc, char** argv)
  {
    vector<int> myVector;
    for (int i = 0; i < 10; i++) {
      myVector.push_back(i);
    }
  
    // print the contents of the vector
    copy(myVector.begin(), myVector.end(), ostream_iterator<int>(cout, " "));
    cout << endl;
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.