exctern C

时间:2022-05-28 22:51:10

在C 中调用C语言

因为C 扩展了函数重载。编译时会将函数名修改,所以直接条用会出错。

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

/*

#include <stdio.h>

void show()

*/

#ifdef __cplusplus
}
#endif // __cplusplus

把要是C编译的代码给extern “”C“”{起来}