Syntax:
The typedef keyword allows you to create a new alias for an existing data type. This is often useful if you find yourself using a unwieldy data type - you can use typedef to create a shorter, easier-to-use name for that data type. For example:
(typedef关键字允许你为一个已存在的数据类型创建一个别名.如果你正在使用一个笨拙数据类型,这是非常有用的.你可以使用typedef为这个类型创建一个简短的,容易使用的名字,例如:)
The syntax above is a simplification. More generally, after the word "typedef", the syntax looks exactly like what you would do to declare a variable of the existing type with the variable name of the new type name. Therefore, for more complicated types, the new type name might be in the middle of the syntax for the existing type. For example:
(上面的语法是非常简单的. 更一般的是, 在"typedef"后面的语法非常像你在使用一个已存在的类型声明一个变量,然后用这个变量名作为新类型的名字,因此, 更复杂的类型, 新的类型名可能位于语法声明的中间,例如:)