Typedef

typedef is a reserved keyword in the programming languages C, C++, and Objective-C. It is used to create an additional name (alias) for another data type, but does not create a new type,[1] except in the obscure case of a qualified typedef of an array type where the typedef qualifiers are transferred to the array element type.[2] As such, it is often used to simplify the syntax of declaring complex data structures consisting of struct and union types, although it is also commonly used to provide specific descriptive type names for integer data types of varying sizes.[1]

  1. ^ a b Kernighan, Brian W.; Ritchie, Dennis M. (1988). The C Programming Language (2nd ed.). Englewood Cliffs, New Jersey.: Prentice Hall. p. 147. ISBN 0-13-110362-8. Retrieved 18 June 2016. C provides a facility called typedef for creating new data type names. … It must be emphasized that a typedef declaration does not create a new type in any sense; it merely adds a new name for some existing type.
  2. ^ "const type qualifier". cppreference.com. Retrieved 2020-10-20.