Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What does typedef mean in c language?
What does typedef mean in c language?
Typedef is a keyword in C language, which is used to define a new name of a data type. The data types here include internal data types (int, char, etc. ) and user-defined data types (struct, etc. ).

Typedef is generally used in programming for two purposes, one is to give variables a new name that is easy to remember and has a clear meaning, and the other is to simplify some complicated type declarations.

Extended data:

C language allows users to define their favorite data type names with typedef keywords, instead of default basic type names, array type names, pointer type names and user-defined structure type names, type names used by * *, enumeration type names, etc.

Once users define their own data type names in the program, they can use their own data type names to define the types of variables, arrays, pointer variables and functions.

For example, C does not provide Boolean types before C99, but you can define a simple Boolean type with typedef keyword.

Baidu encyclopedia -—typedef