Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ string to vector int

#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 );
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #vector #int
ADD COMMENT
Topic
Name
7+3 =