Search
 
SCRIPT & CODE EXAMPLE
 

CPP

vector of int to string c++

#include <vector> // vector 
#include <sstream> // string stream 
#include <iterator> // ostream_iterator 
#include <iostream> // cout 
using namespace std;

int main()
{
    vector<int> nums = {10, 7, 76, 415};
    stringstream result;
    copy(nums.begin(), nums.end(), std::ostream_iterator<int>(result, ""));
    string n = result.str();
    cout << n;
}

Comment

PREVIOUS NEXT
Code Example
Cpp :: how to free the vector c++ 
Cpp :: unclebigbay 
Cpp :: c++ check if file exits 
Cpp :: function as argument in another function in c++ 
Cpp :: how to get double y dividing 2 integers in c++ 
Cpp :: Sort array using inbuilt sort function in decreasing order 
Cpp :: float max value c++ 
Cpp :: how to get last element of set in c++ 
Cpp :: c++ check if string contains uppercase 
Cpp :: string to integer convert c++ 
Cpp :: how to get command arguments c++ 
Cpp :: getch c++ library 
Cpp :: opencv c++ hello world 
Cpp :: reverse c++ string 
Cpp :: remove first element from vector c++ 
Cpp :: how to round a double to 2 decimal places in c++ 
Cpp :: string to number in c++ 
Cpp :: chrono start time in c++ 
Cpp :: take pieces of a string in c++ 
Cpp :: for loop with array c++ 
Cpp :: c++ nagetive to positive numbers 
Cpp :: how to clear vector c++ 
Cpp :: how to remove an element from a vector by value c++ 
Cpp :: push_back struct c++ 
Cpp :: all possible permutations of characters in c++ 
Cpp :: coordinate in 1d array c++ 
Cpp :: built in factorial function in c++ 
Cpp :: naive pattern matching algorithm 
Cpp :: insert only unique values into vector 
Cpp :: c++ lambda 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =