c语言编写的文件
#ifdef __cplusplus
extern "C"{ //告诉编译器下面的代码可能C++需要调用,因此不能简化重命名
#endif
#include"teset1.h"
void fun();
#ifdef __cplusplus
}
#endif
C++只要包含#include"test.h"头文件,就可以调用fun()函数
c语言编写的文件
#ifdef __cplusplus
extern "C"{ //告诉编译器下面的代码可能C++需要调用,因此不能简化重命名
#endif
#include"teset1.h"
void fun();
#ifdef __cplusplus
}
#endif
C++只要包含#include"test.h"头文件,就可以调用fun()函数