如何用2个C语言文件写一个完整的hello,要求弄够相互调用,在此谢谢各位了!把代码给我就行
望楼主采纳:
/************* hello.h ***************/
#include <stdio.h>
#include <stdlib.h>
void func();
/******* hello.c ************************/
#include "hello.h"
void func()
{
printf("Hello World.\n");
}
/******* main.c**************/
#include "hello.h"
int main(int argc,char *argv[])
{
func();
system("pause");
return 0;
}
这样就可以了,一个test.h 一个test.c
这样就可以了,一个test.h 一个test.c