Skip to content

Instantly share code, notes, and snippets.

@alivcor
Last active June 8, 2017 20:50
Show Gist options
  • Save alivcor/e53712ef111fccfa835763cbbaf738b8 to your computer and use it in GitHub Desktop.
Save alivcor/e53712ef111fccfa835763cbbaf738b8 to your computer and use it in GitHub Desktop.
C++ Function to print contents of an unnested Int Vector
#include <iostream>
#include "vector"
#include "string"
using namespace std;
void printIntVector(vector<int>& nums){
string s;
for(auto it = nums.begin();it!=nums.end(); ++it){
s.append(to_string(*it));
s.append(", ");
}
std::cout << s.substr(0,s.length()-2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment