一、主函数文件要include 头文件 fun.h
#include <iostream>
#include "fun.h"
using namespace std;
int main()
{ int a=6,b=4;
cout<<fun(a,b);
return 0;
}
二、头文件fun.h 写具体函数的声明
int fun(int,int);
三、源文件fun.cpp,写子函数定义
int fun(int a, int b){
return a+b;
}
