fork(3) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. std::string vector_name = "positive";
  9. std::string fullPath = "/home/user/folder/name.of.another_file.txt";
  10. std::size_t lastIndex = fullPath.find_last_of(".");
  11. fullPath.insert(lastIndex, "_" + vector_name);
  12. cout << fullPath;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
/home/user/folder/name.of.another_file_positive.txt