c 语言.h头文件

c 语言中.h头文件可以理解为包,当然你可以自定义包

新建.h文件 test.h 包内只有一个函数

void hello(void)
{
	printf("打工是万万不能的,这辈子是不能给别人打工的\n");
}

主函数main.c

#include <stdio.h>
#include "test.h"
 
int main()
{
	hello();
	return 0;
}
gcc main.c
./a.out
打工是万万不能的,这辈子是不能给别人打工的
posted @ 2022-08-19 22:53  luoganttcc  阅读(5)  评论(0)    收藏  举报