In C++, it is possible to define and declare functions in separate files.
Separating definitions from declarations is not strictly necessary, but it does have a number of benefits. Most notably, it is possible to have more incremental builds with this approach.
To define a function, simply provide the function signature in a header file.
#pragma once
#include <string>
int foo(const std::string&, const std::string&);
The declaration is the implementation of the function. In a cpp file, provide the implementation of the function with the same signature as in the header.
#include "bar.hpp"
#include <string>
int foo(const std::string& s1, const std::string& s2) {
return std::stoi(s1) + std::stoi(s2);
}