gpt4 book ai didi

c - C中的对象是什么?

转载 作者:太空狗 更新时间:2023-10-29 16:29:40 25 4
gpt4 key购买 nike

我不是在谈论 C++ 或 Objective C 中的对象。我试图理解“对象”在 this text 的上下文中的含义。 :

If the declaration of a file-scope identifier for an object or a function contains the storage-class-specifier static, the identifier has internal linkage. Otherwise, the identifier has external linkage. See Storage Classes for a discussion of the storage-class-specifier nonterminal.

Within one translation unit, each instance of an identifier with internal linkage denotes the same identifier or function. Internally linked identifiers are unique to a translation unit.

我已经在其他不同的 C 主题中看到过“对象”这个词。但是当我用谷歌搜索时,我只得到了对 C++ 的引用。

我也看了herehere .

最佳答案

C11 标准第 3.15 节定义了术语对象:

object

region of data storage in the execution environment, the contents of which can representvalues

您的 MSDN 链接上的文本是从 C11 标准的第 6.2.2/3 节复制粘贴的(没有署名!)。

要解释这个定义,数据存储区域是关键部分。所有变量都是对象,对象也可以通过malloc分配。

关于c - C中的对象是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26581007/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com