Check out example codes for "string to vector c++". It will help you in understanding the concepts better.

Code Example 1

#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;
}

Learn ReactJs, React Native from akashmittal.com