What is the usage of typedefstruct
typedef means type definition. typedefstruct is to use this structure for convenience. The specific difference is:
If structnode{} defines the structure like this. In the application of node’s variables, you need to write this way, structnoden; if you use typedef, you can write this way, typedefstructnode{}NODE;. When applying for a variable it can be written like this, NODEn; the difference lies in the use, whether or not the struct keyword can be omitted.
typedefstruct role:
typedef can declare a new type name to replace the existing type name, but can not add a new type. typedef for the C language keyword, the role of the C language is to define a new name for a data type. Data types here include internal data types (int, char, etc.) and custom data types (struct, etc.).
The purpose of using typedef in programming is generally twofold: to provide a new name for a variable that is easy to remember and clear in meaning (a new alias for the type, which facilitates the definition of the variable), and to simplify some of the more complex type declarations.