C/C++ static extern的问题

[复制链接]
查看11 | 回复2 | 2009-8-21 10:02:09 | 显示全部楼层 |阅读模式
#includevoid x(void);void y(void);int main(void){ ;}void y(void){ static char b = '2'; ;}int a = 1;//a 改成这样,全局变量存储类型是static的,没有static标识链接属性是 externalvoid x(void){ int c = 3; static char b = '2'; static float d = 4;}b 的解释:链接属性 (none) 表示 被当做单独的实体,也就是该标识符的多个声明...
回复

使用道具 举报

千问 | 2009-8-21 10:02:09 | 显示全部楼层
static char b = 2;void y(){return;}extern int a;void x(){int c = 3;static float d = 4.0;return;}另一个C文件中定义全局变量a:int a = 1;...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行