There is a
C++
way to do that, try:
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
int main()
{
vector < string > v{ "10", "20", "30" };
for (const auto & x : v)
{
istringstream iss(x);
int n;
iss >> n;
cout << n << endl;
}
}