代码改变世界

随笔档案-2010年7月10日

C++项目中的extern "C" {}

2010-07-10 19:45 by 吴秦, 181260 阅读, 收藏, 编辑
摘要: 引言在用C++的项目源码中,经常会不可避免的会看到下面的代码:#ifdef __cplusplusextern "C" {#endif/*...*/#ifdef __cplusplus}#endif它到底有什么用呢,你知道吗?而且这样的问题经常会出现在面试or笔试中。下面我就从以下几个方面来介绍它:1、#ifdef _cplusplus/#endif _cplusplus及发散2、extern "C"2.1、extern关键字2.2、"C"2.3、小结extern "C"3、C和C++互相调用3.1、C++的编译和 阅读全文
点击右上角即可分享
微信分享提示