vector of int to string c 2b 2b

Solutions on MaxInterview for vector of int to string c 2b 2b by the best coders in the world

showing results for - "vector of int to string c 2b 2b"
Sara
28 Mar 2017
1#include <vector> // vector 
2#include <sstream> // string stream 
3#include <iterator> // ostream_iterator 
4#include <iostream> // cout 
5using namespace std;
6
7int main()
8{
9    vector<int> nums = {10, 7, 76, 415};
10    stringstream result;
11    copy(nums.begin(), nums.end(), std::ostream_iterator<int>(result, ""));
12    string n = result.str();
13    cout << n;
14}
15
16