exctern C

在C++中调用C语言

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

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

/*

#include <stdio.h>

void show()

*/

#ifdef __cplusplus
}
#endif // __cplusplus

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

原文地址:https://www.cnblogs.com/qq376142178/p/12330405.html