exctern C

在C++中调用C语言

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

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

/*

#include <stdio.h>

void show()

*/

#ifdef __cplusplus
}
#endif // __cplusplus

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

posted @ 2020-02-19 11:23  A_Powered  阅读(248)  评论(0编辑  收藏  举报