博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年8月18日

摘要: 一、extern "C"讲解extern "C"是使C++能够调用C写作的库文件的一个手段,如果要对编译器提示使用C的方式来处理函数的话,那么就要使用extern "C"来说明。__cplusplus是cpp中的自定义宏,那么定义了这个宏的话表示这是一段cpp的代码。main.cppextern void f1();int main(){ f1(); return 0;}a.cpp#include <stdio.h>void f1(){ printf("test\n");}makefileall: g+ 阅读全文

posted @ 2012-08-18 11:08 开源云 阅读(722) 评论(0) 推荐(0) 编辑