You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
这个能扯的其实很多,按照语言层面的标准回答,使用文档的描述最为合适:"C",可以与使用 C 程序语言编写的函数进行链接,使得在 C++ 程序中定义能从 C 单元调用的函数成为可能。 标准并不在乎是如何做到的,如果还要讲,那就是符号修饰,等等。不同平台,不同编译器,即使都使用了 extern "C" 符号修饰也不一定一样,C 标准不存在 ABI,有兴趣可以自己了解。
The text was updated successfully, but these errors were encountered:
描述的是:
不管是第一句话还是第二句话,都是既不严谨,也错误的。
并且我严重怀疑抄了知乎的一篇文章,描述简直一模一样。
extern
类型的”,这话很莫名其妙,extern
不是类型。非要狡辩一下那就是,写的时候想着:“语言链接是每个函数类型的一部分”;但也和
extern
没关系。extern "C"
符号修饰也不一定一样,C
标准不存在ABI
,有兴趣可以自己了解。The text was updated successfully, but these errors were encountered: