先写头文件.h结尾

    1. #pragma once
    2. #define _CRT_SECURE_NO_WARNINGS
    3. #include<stdio.h>
    4. #include<string.h>
    5. #include<stdlib.h>
    6. 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方式
    方法一,旧的程序
    image.png
    方法二

    `#pragrame once
    //声明语句