#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
struct Teacher
{
char name[50];
int age;
};
struct Teacher t1;
struct Teacher2
{
char name[50];
int age;
}t3 = {"tom", 66};
struct
{
char name[50];
int age;
}t5;
struct Teacher t7 = { "lily", 18 };
typedef struct Teacher3
{
char name[50];
int age;
}Teacher3;
struct Teacher3 t8;
Teacher3 t9;
int main(void)
{
struct Teacher t2;
printf("%s, %d
", t7.name, t7.age);
strcpy(t2.name, "xiaoming");
t2.age = 22;
printf("%s, %d
", t2.name, t2.age);
struct Teacher *p = NULL;
p = &t2;
strcpy(p->name, "xiaojiang");
p->age = 22;
printf("%s, %d
", p->name, p->age);
return 0;
}