#include #include struct tree { int num; struct tree *Lchild; struct tree *Rchild; }*head; struct tree *insert(struct tree **p0,int x) /*就改了这个参数,原因是一级指针不能返回申请的内存,因为参数副本问题*/ { struct tree *p1; /*建立 一个排序二叉树*/ if(*p0==NULL) { p1=(struct tree *)malloc(s
指针可以指向一份普通类型的数据,例如 int、double、char 等,也可以指向一份指针类型的数据,例如 int *、double *、char * 等。
如果一个指针指向的是另外一个指针,我们就称它为二级指针,或者指向指针的指针。
假设有一个 int 类型的变量 a,p1是指向 a 的指针变量,p2 又是指向 p1 的指针变量,它们的关系如下图所示:
将这种关系转换为C语言代码:
int a =100;
int *p1 = &a;
int **p2 = &p1;
指针变量也是一种变量