To call functions defined in a different file you need to do two things.
1- Make the function visible in the point where you want to call it.
In practice this means that you need to supply a function prototype to the file that wants to call the function. Function prototypes are composed of the return type, name and parameters of the function. Example
void ProfitabilityRatios(int arg1, double arg2);
A function prototype doesn't define what the function does, only what it looks like. Pay attention to the semicolon.
What you want to do is create a header file where you will write all your prototypes, and then #include it in any file where you want to use them.
2- Create a new file where you will define the functions, then compile and link it to your main code.
Create a new .cpp file. In that file you will #include the header with the prototypes and then proceed to write what the functions do, just like when you define them in a single file.
To compile and link: if you are using an IDE (Visual Studio, Dev-C++) then you will have to add the file to the project and that will usually take care of everything. If you are using command line GCC simply add the file for cokmpilation. Like this
g++ main.cpp functions.cpp -o program |