then in the main file, include the other cpp file, or if you have the declaration of the function in a header, include the header in the main file and include the header in the cpp file that the function is defined.
Example:
My main cpp file:
1 2 3 4 5 6 7 8 9
#include "header.h"
int main()
{
int x = 0;
function(x);
return 0;
}
My header file:
1 2 3 4 5
#ifndef _HEADER_H_
#define _HEADER_H_
int function(int x);
#endif
My other cpp file:
1 2 3 4 5 6 7 8
#include "header.h"
int function(int x)
{
x = 5;
return x;
}