什么是extern关键字是什么意思? [英] What does the extern keyword mean?

查看:216
本文介绍了什么是extern关键字是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是的extern 关键字是什么意思?我看到,在一个函数声明的面前就像

 的extern无效DoFoo ...


解决方案

的extern 起名的外部链接的。这意味着该对象或功能是通过从程序中的其它翻译单元这名访问。对于功能,这是在任何情况下,以便其使用缺省键(在这种情况下)通常是多余的。

What does the extern keyword mean? I've seen that in front of an function declaration like

extern void DoFoo ...

解决方案

extern gives a name external linkage. This means that the object or function is accessible through this name from other translation units in the program. For functions, this is the default linkage in any case so its usage (in this context) is usually redundant.

这篇关于什么是extern关键字是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆