Definition vs declaration
2024-10-21 06:20:26
#include <stdio.h>
union test1; // declaration
union test2 { // The definition of union test2
int a;
}
union test3 { // The test4 definition of type union test3
int b;
} test4;
declaration : 告訴 compiler 如何解讀 identifier,
及接受這個 reference of identifier,
也就是類似 extern int a;
translation unit 沒有定義 a,
所以先接受有 a,先 compile,
link 階段再連結。
definition of object : 在 memory 配置一塊 空間儲存其值,
link phase時, linker 會去連結變數。
definition 可以用在 define union test1,define object,不是每個定義,都會配置 memory:
最新文章
- poj 3728(LCA + dp)
- 敏捷项目开源管理软件ScrumBasic(2)- 多项目支持
- OpenSSL-for-IOS
- C#_加密解密
- jQuery toggle方法的一个奇怪表现。
- WPF——执行命令清空文本框
- Java中List和ArrayList的区别(转)
- [AngularJS + Webpack] Uglifying your JavaScript
- windows服务(Windows Installer问题,错误5:拒绝访问)
- HTML5面试题-备
- codeforces 416B. Appleman and Tree 树形dp
- 【oracle案件】ORA-19502,ORA-27072
- C#中对属性和字段的理解
- easyui 翻译
- Linux CentOS下MySQL的安装配置之浅谈
- TileMap Editer 编辑器工具介绍
- for 没有作用域的说话
- 细数那些不懂Spring底层原理带来的伤与痛
- ADB 运行原理
- python使用Fabric模块实现自动化运维