找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 254|回复: 1

Question1.11:What does extern mean in a function declaratin?

[复制链接]

210

主题

371

回帖

0

积分

管理员

积分
0
发表于 2013-7-17 20:04:46 | 显示全部楼层 |阅读模式

Q: What does extern mean in a function declaration?
A: extern is significant only with data declarations. In function declarations, it can be used as a stylistic hint to indicate that the function's definition is probably in another source file, but there is no formal difference between
                        extern int f();
and
                          int f();
See also question 1.10.

210

主题

371

回帖

0

积分

管理员

积分
0
 楼主| 发表于 2013-7-17 20:11:42 | 显示全部楼层
问题:extern在一个函数声明中是什么意思?
回答:extern只是在数据声明的时候是有意义的。在函数声明中,它只是用作一个格式上的暗示来表明函数的定义可能是在另一个源文件中的。但是在extern int f();和int f();之间是没有什么差别的。
参考问题1.10。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

果子博客
扫码关注微信公众号

Archiver|手机版|小黑屋|风叶林

GMT+8, 2026-2-2 02:52 , Processed in 0.077074 second(s), 20 queries .

Powered by 风叶林

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表