gpt4 book ai didi

c - C和派生数据类型?

转载 作者:行者123 更新时间:2023-12-02 06:22:57 26 4
gpt4 key购买 nike

我知道 C 中的基本数据类型-char,int,float等。但是 C 语言中的派生数据类型到底是什么?

最佳答案

the standard (well, a draft; hooray free :)的6.2.5.20涵盖了派生类型:

20 Any number of derived types can be constructed from the object, function, and incomplete types, as follows:
-- An array type describes a contiguously allocated nonempty set of objects with a particular member object type, called the element type. Array types are characterized by their element type and by the number of elements in the array. An array type is said to be derived from its element type, and if its element type is T, the array type is sometimes called array of T. The construction of an array type from an element type is called array type derivation.
-- A structure type describes a sequentially allocated nonempty set of member objects (and, in certain circumstances, an incomplete array), each of which has an optionally specified name and possibly distinct type.
-- A union type describes an overlapping nonempty set of member objects, each of which has an optionally specified name and possibly distinct type.
-- A function type describes a function with specified return type. A function type is characterized by its return type and the number and types of its parameters. A function type is said to be derived from its return type, and if its return type is T , the function type is sometimes called function returning T. The construction of a function type from a return type is called function type derivation.
-- A pointer type may be derived from a function type, an object type, or an incomplete type, called the referenced type. A pointer type describes an object whose value provides a reference to an entity of the referenced type. A pointer type derived from the referenced type T is sometimes called pointer to T. The construction of a pointer type from a referenced type is called pointer type derivation.

These methods of constructing derived types can be applied recursively.

关于c - C和派生数据类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6025465/

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