Definition: 定義
occurs in only one place (只能出現一次)
specifies the type of an object; reserves storage for it; is used to create new objects
example:
1 | int my_array[100]; |
Declaration: 宣告
can occur multiple times (可以出現多次)
describes the type of an object; is used to refer to objects defined elsewhere (e.g., in another file)
example:
1 | extern int my_array[]; |
如果你覺得這篇文章不錯,歡迎打賞
BTH: 35QooNA82isrmQLmpEnqXpJoxeZmaPubPf
ETH:0x4cf61fea5EA842D202B85158d8b5e239C872De46