结构体的第一种方式
typedef struct _person
{
char name[20];
char sex[4];
unsigned char age;
int height;
float weight;
}person,*pperson;
第二种方式
struct _person
{}
char name[20];
char sex[4];
unsigned char age;
int height;
float weight;
};
typedef struct _person person;
person,pperson都是类型;pperson是person*
结构体内可以放时间
结构体自引用
struct A
{
int unm;
struct A a;
}
节点
struct Node
{
int data;数据域
struct Node next;
};
无法确定Node类型的大小
struct Node
{
int data;数据域
struct Node *node;指针域
};
指针大小为四个字节
struct Node node1,node2;
node1.data=45;
node1.next=&node2;
node1.next->=90;
node1.next->next
自引用带指针,链表格式