请问 extern "C" 什么意思?

koko2031 2001-12-03 11:07:47
不太明白extern "C" 什么意思,
我知道 extern 变量 什么意思,但这个表示什么呢?
...全文
95 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
snowyangel 2002-04-02
  • 打赏
  • 举报
回复
http://www.csdn.net/expert/topic/370/370793.xml?temp=.1220667
yuxingcao 2001-12-05
  • 打赏
  • 举报
回复
msdn
Cline 2001-12-05
  • 打赏
  • 举报
回复
copy+paste
koko2031 2001-12-03
  • 打赏
  • 举报
回复
这是个小问题呀?怎么加分?
szmylove 2001-12-03
  • 打赏
  • 举报
回复
加分,1分的问题不予回答
koko2031 2001-12-03
  • 打赏
  • 举报
回复
谢谢!你是外国人吗?我要翻译一下
Cline 2001-12-03
  • 打赏
  • 举报
回复
You'll notice the extern "C" modifier. You should use this modifier only if you are writing C++ code, not straight C code. Normally, C++ compilers mangle function and variable names, which can lead to severe linker problems. For example, imagine writing a DLL in C++ and an executable in straight C. When you build the DLL, the function name is mangled, but when you build the executable, the function name is not mangled. When the linker attempts to link the executable, it will complain that the executable refers to a symbol that does not exist. Using extern "C" tells the compiler not to mangle the variable or function names and thereby make the variable or function accessible to executable modules written in C, C++, or any other programming language.

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧