您的位置:首页 > 其它

What's a Declaration? What's a Definition?

2010-11-02 16:53 106 查看
Objects in C must have exactly one definition, and they may have mutiple external declarations.

Definition: occurs in only one place. specifies the type of an object; reserves storage for it; it is used to create new objects.

example: 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: extern int my_my_array[];

difference between array and pointer.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: