C语言.h头文件

文章链接

test.h

    void hello(void)
    {
        printf("hello world\n");
    }                                                                                                                                                                                                        

p.c

#include <stdio.h>
#include "test.h"

int main()
{
        hello();
        return 0;
}

gcc p.c
./a.out
hello world

.h的文件可以理解为自己写的包

posted @ 2022-08-19 22:54  luoganttcc  阅读(7)  评论(0)    收藏  举报