fork(9) download
  1. #include <sstream>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. std::istringstream iss(" abcd 1234 -6242 1212");
  7.  
  8. std::string s;
  9. int a, b, c;
  10.  
  11. iss >> s >> a >> b >> c;
  12.  
  13. std::cout << s << " " << a << " " << b << " " << c << std::endl;
  14. }
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
abcd 1234 -6242 1212