结构体
typedef struct TreeNode *Tree; //联系struct TreeNode 和 *Tree
struct TreeNode { //必须用struct TreeNode,Tree并非一个indentifier
int Element;
Tree Left;
Tree Right;
};
Tree a = malloc(sizeof(Tree));
//a->Element == (*a).Element
或者
typedef struct queue
{
Tree tree;
struct queue* next;
}QUEUE; //联系struct queue{}和QUEUE
QUEUE *Q = (QUEUE*)malloc(sizeof(QUEUE));
指针传递
int a=1,b=2;
int *pa=&a,*pb=&b,*p;
p = pa;
//*p = *pb;这样*pa也变成了b
//p = pb;这样*pa不受影响,只是p存储的位置重新指向了pb