defining function in other file code example
Example: defining function in other file
//Your .h file..
#ifndef MY_HEADER
#define MY_HEADER
int add(int, int);
#endif
//main.cpp
#include "myHeader.h"
int main()
{
int result = add(1,2);
return 0;
}
//file that contain definition of the functions...
//.cpp
#include "myHeader.h"
int add(int a, int b)
{
return a+b;
}