Last active
July 1, 2018 00:34
-
-
Save TheEyesightDim/07ac15353f3471e02f47eec9b9f0758d to your computer and use it in GitHub Desktop.
Example of using ostream iterators with standard algorithms to produce interesting results.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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