fork(37) download
  1. #include <string>
  2. #include <iostream>
  3. #include <vector>
  4. #include <boost/algorithm/string.hpp>
  5.  
  6. int main()
  7. {
  8.  
  9. std::wstring m_inputText = L"hi how are you?";
  10.  
  11. std::vector<std::wstring> tok;
  12. split(tok, m_inputText, boost::is_any_of(L" "));
  13.  
  14. for(std::vector<std::wstring>::iterator tok_iter = tok.begin();
  15. tok_iter != tok.end(); ++tok_iter)
  16. {
  17. std::wcout << *tok_iter << '\n';
  18. }
  19.  
  20. }
  21.  
Success #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout
hi
how
are
you?