I tried looking this up and got mixed results using header files and such.
Basically I have multiple cpp files with all my functions I made for use with binary trees, B
That is quite simple, as JMAA said you should do some research to understand these concepts, but being practical, this is what you would do:
You'll define an functionsExample.cpp where you have to define all your functions and also an functionsExample.h where you'll declare your functions.
You'll have this as the functionsExample.cpp:
#include
int example(int x, int y)
{
return x + y;
}
Ans this as functionsExample.h:
#ifndef FUNCTIONSEXAMPLE_H
#define FUNCTIONSEXAMPLE_H
int example(int x, int y);
#endif
Then in the cpp you want to run the example function, simply add:
#include "functionsExample.h"
But as I said, you should do some research about header guards, preprocessor directives and files organization to have a deeper knowledge about this. Some links I would recommend:
Header Files
Preprocessor Directives