1 2 3 4 5 6 7 8 9 10 11 12 13
#include <string> #include <sstream> #include <iostream> int main() { std::string mystring("1 2 3"); std::istringstream is(mystring); int one, two, three; is >> one >> two >> three; printf("%i %i %i", one, two, three); }