Answers for "vector to string c++"

C++
1

string to vector c++

#include <iostream>
#include <string>
#include <vector>
 
int main()
{
    std::string s = "Hello World!";
 
    std::vector<char> v(s.begin(), s.end());
 
    for (const char &c: v)
        std::cout << c;
 
    return 0;
}
Posted by: Guest on June-02-2020
0

vector to string c++

std::vector<char> input({ 'a', 'b', 'c' });
std::string s(input.begin(), input.end());
Posted by: Guest on May-05-2021

Browse Popular Code Answers by Language