fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using std::vector;
  5. using std::cout;
  6. using std::string;
  7. #include <boost/foreach.hpp>
  8. #include <boost/filesystem.hpp>
  9. namespace bfs = boost::filesystem;
  10.  
  11. int main(int argc, char** argv)
  12. {
  13. vector<string> args(argv+1, argv+argc);
  14. BOOST_FOREACH(const bfs::path& filename, args)
  15. {
  16. // intentional memory leak
  17. string* idp = new string(filename.string());
  18. string& id = *idp;
  19. cout << filename.string() << " "
  20. << id
  21. << "\n";
  22. }
  23. return 0;
  24. }
  25.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty