[helper.hpp] std::string myReplace(const std::string& s); [helper.cpp] std::string myReplace(const std::string& s) { ... } [somefile.cpp] #include "helper.hpp" otherString3 = myReplace(myString3);