fork(2) download
  1. #include <iostream>
  2. #include <string>
  3. #include<boost/algorithm/string/split.hpp>
  4. #include <boost/algorithm/string.hpp>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.  
  10. std::string res = "asd/qwe/rty";
  11. std::vector<std::string> details;
  12. boost::split(details, res, boost::is_any_of("/"));
  13.  
  14. for (std::vector<std::string>::iterator pos = details.begin(); pos != details.end(); ++pos) {
  15. cout << *pos << endl;
  16. }
  17. }
Success #stdin #stdout 0s 3288KB
stdin
Standard input is empty
stdout
asd
qwe
rty