A simple example C++ program to demonstrate the use of user-defined functions using multiple files in the program.
Question for the program (taken from Codeacademy's "Learn C++" course):
In main.cpp, we have a program with a few functions. Let’s move them into a different file.
First, add a declaration for each function in main.cpp above the functions above main().
Now, move all of the function definitions over to my_functions.cpp.
Finally, compile and execute your code. Remember to link the two .cpp files when compiling.