Skip to content

Instantly share code, notes, and snippets.

@TheEyesightDim
Last active July 1, 2018 00:34
Show Gist options
  • Save TheEyesightDim/07ac15353f3471e02f47eec9b9f0758d to your computer and use it in GitHub Desktop.
Save TheEyesightDim/07ac15353f3471e02f47eec9b9f0758d to your computer and use it in GitHub Desktop.
Example of using ostream iterators with standard algorithms to produce interesting results.
#include <vector>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
std::vector<int> v {7,4,1,8,5,2,9,6,3};
std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout , " "));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment