不明白为什么二叉树create仍然是NULL。。。
#include <stdio.h>
#include <stdlib.h>
typedef struct tree { //二叉树结构
char data;
struct tree *Llink;
struct tree *Rlink;
struct tree *Parent;
} BTNode,*BinTree;
void CreateTree(BinTree *bt) { //先序创建二叉树
char in;
while (scanf ("%c",&in)) {
if (in=='.') {
fflush (stdin);
*bt=NULL;
return;
} else {
fflush (stdin);
*bt=(BinTree)malloc(sizeof(BTNode));
(*bt)->data=in;
}
CreateTree (& ((*bt)->Llink));
CreateTree (& ((*bt)->Rlink));
}
}
int main( ) {
BinTree bt = NULL;
CreateTree(&bt);
if (bt==NULL) printf ("NULL");
}