先写头文件.h结尾
#pragma once#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<string.h>#include<stdlib.h>extern int a1(int a, int b);
然后在其他文件中
#include "1头文件.h"
int main()
{
int a = a1(1, 3);
printf("%d\n", a);
system("pause");
return EXIT_SUCCESS;
}
为了避免同一个文件被include多次,c/c++中有两种方式,一种是#ifndef方式,一种是#pragrame once方式
方法一,旧的程序
方法二
`#pragrame once
//声明语句
