typedef struct Student
{
int data;
struct Student*next;
}Student_info;
上面的Student是标识符,
Student_info是变量类型,相当于是int char等变量类型。
上面的定义相当于
struct Student{
int data;
struct Student *next;
}
+typedef struct Stdent Student_info;
这样我们就可以用Student_info来定义结构体变量了。
例子:
Student_info *p;
C语言结构体typedef定义解析
博客介绍了C语言中使用typedef定义结构体的方法。通过代码示例展示了如何用typedef将struct Student定义为Student_info,使其可作为变量类型使用,还给出了用Student_info定义结构体变量的例子。
1336

被折叠的 条评论
为什么被折叠?



