convert set string to vector string c++ code example
Example 1: convert vector to set c++
#include <set>
std::set<std::string> set_name(vector_name.begin(), vector_name.end());
Example 2: 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;
}