You can't use main twice in the same program. There really is no need to either here let me whip something up for you to look at
Code:
//This is the header file which will allow you to call a function
//defined in another cpp file
#ifndef _TEST_H
#define _TEST_H
int add(int a, int b);
int subtract(int a, int b);
#endif//_TEST_H
Code:
//This is the cpp file which defines add and subtract
#include "test.h"
int add(int a, int b)
{
return (a+b)
}
int subtract(int a, int b)
{
return (a-b)
}
Code:
//this is your main.cpp file
#include <iostream>
#include "test.h"
using std::cout;
using std::cin;
int main()
{
cout<<add(1,9);
cout<<subtract(9,1);
cin.get();
return 0;
}