What do you mean by “code for non-VEX code/libraries”. Vex code uses c++ all the fundamentals are the same. If you are trying to find out about vex function here is VEXcode API Reference.
With c++ to access stuff defined in other files you need to include them. However it isn’t that simple, since the compiler looks at everything in src folder. Like @Deicer said you need to add a forward declaration of the function like this…
void function(int input);
or for varaibles…
extern int variable;
Including the file, where the function is actually defined will cause an error multiple definition of 'function(int)'
. If the files is in the src folder, a forward declaration is all you need. The convention is to put these forward declarations in a header file, located in the include folder and include that file instead of put all the forward declarations in the main file.
Also you should use include guards and include the header file in the complimentary cpp file. This isn’t necessary for only function, but is sometimes need when creating classes to make things easier and prevent redefinition. Either way, you can just add it to not worry about that later. Include guard…
#pragma once