Type-Defined Strutures

来源:互联网 发布:未找到数据库服务器 编辑:程序博客网 时间:2024/06/01 09:05

We can use the keyword typedef to define a structure as follows:

typedef struct{...type member1;type member2;...} type_name;


The type_name represents structure definition associated with it and therefore can be used to declare structure variables as shown below:

              type_name variable1, variable2,....;

Remember that (1) the name type_name is the type definition name, not a variable and (2) we cannot define a variable with typedef declaration.

原创粉丝点击