Type

From cppreference.com
< c‎ | language

Objects, functions, and expressions have a property called type. Type determines the interpretation of an otherwise generic sequence of bits comprising the value of an object or the value returned from a function or expression. Type also determines which operations are valid.

[edit] Type classification

The C type system is an heirarchy of types and type categories:

  • complete type (having sufficient information to determine the size of an object of that type)
  • object type (a type that describes an object)
  • scalar type
  • arithmetic type
  • integer type
  • char
  • signed integer type
  • standard signed integer type
  • signed char
  • short int
  • int
  • long int
  • long long int
  • extended signed integer type
  • unsigned integer type
  • standard unsigned integer type
  • unsigned char
  • unsigned short int
  • unsigned int
  • unsigned long int
  • unsigned long long int
  • _Bool
  • extended unsigned integer type
  • enumerated type (each distinct enumeration)
  • floating type
  • real floating type
  • float
  • double
  • long double
  • complex type
  • float _Complex
  • double _Complex
  • long double _Complex
  • pointer type
  • pointer to object
  • pointer to function
  • pointer to incomplete type
  • derived type (constructed recursively from the object and function types)
  • aggregate type
  • array type
  • struct type
  • union type
  • function type
  • pointer type (referenced type)
  • atomic type (_Atomic)
  • function type (a type that describes a function)
  • incomplete type (lacking sufficient information to determine the size of an object of that type)
  • void (cannot be completed)
  • incomplete array type (array size is unknown)
  • incomplete struct type
  • incomplete union type

Miscellaneous type categories:

  • atomic, qualified and unqualified type - _Atomic, const, volatile, restrict
  • basic type (complete type)
  • char
  • signed and unsigned integer type
  • floating type
  • character type
  • char
  • signed char
  • unsigned char
  • corresponding real type - always a real floating type
  • real floating type - same type
  • complex type - type given by deleting the keyword _Complex from the type name
  • derived declarator type
  • array type
  • function type
  • pointer type
  • element type - type of the object used as an array element
  • extended integer type
  • extended signed integer type
  • extended unsigned integer type
  • real type
  • integer type
  • real floating type
  • referenced type - pointer type derived from a function type or an object type
  • standard integer type
  • standard signed integer type
  • standard unsigned integer type
  • type category - outermost derivation of a derived type or the type itself

[edit] See also

C++ documentation for C++ Type