C语言中的类型

以下摘自ANSI C标准:

   An object declared as type char is large enough to store any member
of the basic execution character set.  If a member of the required
source character set enumerated in $2.2.1 is stored in a char object,
its value is guaranteed to be positive.  If other quantities are
stored in a char object, the behavior is implementation-defined: the
values are treated as either signed or nonnegative integers.

...

   There are four signed integer types, designated as signed char,
short int, int, and long int. 

...

   For each of the signed integer types, there is a corresponding (but
different) unsigned integer type (designated with the keyword unsigned)
that uses the same amount of storage (including sign information)
and has the same alignment requirements. 

...

   There are three floating types, designated as float , double , and
long double .

...


 * An array type describes a contiguously allocated 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
   members of 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 set of member
   objects, each of which has an optionally specified name and possibly
   distinct type.

 * A union type describes an overlapping 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.''

...

   The type char, the signed and unsigned integer types, and the
enumerated types are collectively called integral types.

...

   Integral and floating types are collectively called arithmetic
types.  Arithmetic types and pointer types are collectively called
scalar types.  Array and structure types are collectively called
aggregate types.

...

   Array, function, and pointer types are collectively called derived
declarator types.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值