Note a new type with typedef

xiaoxiao2021-03-06  34

The C language allows use of typedef to explain a new type name, indicating that the new type name is generally: typedef type name identifier; here, "Type Name" must be a defined type identifier before this statement. "Identifier" is a user-defined identifier that is used as a new type name. The role of the Typedef statement is just the "type name" existing with "identifier", and the new data type is generated. The original type name is still valid. For example: typedef int inteer; this statement indicates an identifier INTEger named by a user as a type name of an int type. After this explanation, an identifier integer can be used to define an integer variable. For example: Integer M, N; equivalent to int M, n; other: Integer is an alias of Int. In order to facilitate identification, general habits use new type names with uppercase letters. Another example: typedef char * charp; charp p; equivalent: char * p;

转载请注明原文地址:https://www.9cbs.com/read-62693.html

New Post(0)