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

Code Example 1

#include <sstream>
#include <vector>
#include <string>

std::string myString = "10 15 20 23";
std::stringstream iss( myString );

int number;
std::vector<int> myNumbers;
while ( iss >> number )
  myNumbers.push_back( number );

Learn ReactJs, React Native from akashmittal.com