fork(3) download
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4. int main()
  5. {
  6. int i = 5;
  7. std::ostringstream oss;
  8. oss << ":/karim/pic" << i << ".jpg";
  9. std::string directory = oss.str();
  10. std::cout << directory << '\n';
  11. }
Success #stdin #stdout 0s 2860KB
stdin
Standard input is empty
stdout
:/karim/pic5.jpg