当前位置:首页 > 技术杂谈 > 正文

exctern C

2024-03-31 技术杂谈

在C 中调用C语言

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

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

/*

#include <stdio.h>

void show()

*/

#ifdef __cplusplus
}
#endif // __cplusplus

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

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/a/17233.html