一.结构体的定义
1.结构体的定义
struct _Teacher { char name[62]; char c; int age; } typedef sturct _Teacher { char name[62]; char c; int age; } Teacher;
2.定义结构体变量的三种方法
a.第一种
Teacher t1; Teacher *p = (Teacher *)malloc(sizeof(Teacher));
b.第二种
struct _Teacher2 { char name[62]; char c; int age; } t2,t3;
c.第三种
struct { char name[62]; char c; int age; } t4;
时间: 2024-10-29 19:09:44