Hello. I haven't quite mastered dealing with compiling lots of functions that all call each other in sophisticated fashions.
Let's say that I have a few functions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// function_1
#include <iostream>
usingnamespace std;
int function_2(/*junk*/);
int function_3(/*much_junk*/);
.
.
.
int function_n(/*more_junk*/);
main()
{
// This uses the junk
}
[code]
// function_2
#include <iostream>
using namespace std;
int function_23();
int function_42();
function_2()
{
// Much more junk //
}
[\code]
What would be the best way of getting this to compile?
You can have as many functions as you want in a single file. That would prevent you from typing all of those annoying characters. However it is often a good idea to keep it split. If you have seperate .cpp files that are all sharing functions, try putting the pre-declared functions into a header (.h) file. Then call that .h file in each of your source files (.cpp).