📜  c++ string to vector int - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:50.776000             🧑  作者: Mango

代码示例1
#include 
#include 
#include 

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

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