What's the difference between these two non-member functions ?
static void
function1() {
std::cout << "Test" << std::endl;
}
void
function2() {
std::cout << "Test" << std::endl;
}
EDIT : I know static means that the function has internal linkage and by default a function in the global scope has external linkage but I don't really see how it will be different then. If we declare a function static or if we don't, we still have to include the file containing the function to use it in another file. It doesn't depend if the function is static or not, right ?
According to cppreference.com :
Internal linkage : The name can be referred to from all scopes in the current translation unit.
External linkage : The name can be referred to from the scopes in the other translation units.