小白求助 结构体定义变量的问题
请教各位大佬 结构体定义变量的 啥时候定义结构体元素TEAC t1;啥时候 定义结构体的指针TEAC* t1;typedef struct Teacher
{
int age;
}TEAC;
void main()
{
/*TEAC t1;
t1.age = 22;
createTeacher(t1);
printf("%d\n", t1.age);*/
/*TEAC t1;
int num = 3;
t1.age = 33;
createTeacher(&t1, num);
printf("%d\n", t1.age);*/
TEAC* t1 = NULL;
int num = 3;
/*t1->age = 33;*/
/*t1 = createTeacherC(num);*/
createTeacherC(&t1, num);
printf("%d\n", t1->age);
system("pause");
}