fork(1) download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <vector>
  4. #include <boost/tokenizer.hpp>
  5. #include <boost/lexical_cast.hpp>
  6. int main()
  7. {
  8. std::string YourStringName = "8573656.5465467.5435325.3253255";
  9. std::vector<long> vectorLong;
  10. boost::tokenizer<> tok(YourStringName);
  11. for(boost::tokenizer<>::iterator i = tok.begin(); i != tok.end(); ++i)
  12. vectorLong.push_back(boost::lexical_cast<long>(*i));
  13.  
  14. for(size_t n =0; n<vectorLong.size(); ++n)
  15. std::cout << vectorLong[n] << ' ';
  16. std::cout << '\n';
  17. }
  18.  
Success #stdin #stdout 0.02s 2872KB
stdin
Standard input is empty
stdout
8573656 5465467 5435325 3253255