编写一个头文件Proc.h
using namespace std;
void Proc()
{
cout<<"Hello World!"<<endl;
}
在编写两个头文件add.h
int add(int a,int b){
return a+b;
}
sub.h
int sub(int a,int b){
return a-b;
}
在主方法中这么写才能保证头文件不被重复引入
int main(int argc, char* argv[])
{
Proc();
return 0;
}
输出:
Hello World!