In Cpp, Dump Vector Of Integers To Console Without Looping Or Recurssion

#include<iostream>
#include<vector>
#include<iterator>
#include<algorithm>

using namespace std;

int main(){
	vector<int> intList;
	intList = {18, 24, 5, 11, 56, 27};
	ostream_iterator<int> screen(cout, ", ");
	copy(intList.begin(), intList.end(), screen);
	return 0;
}

Comments

Popular posts from this blog