在vc6.0为什么这棵树运行不了了??
#include <stdio.h>#include <malloc.h>
#include <stdlib.h>
#define OK 1
#define ERROR 0
#define OVERFLOW 1
typedef int Status;
typedef char ElemType;
typedef struct BiTNode{
ElemType data;
struct BiTNode *lchild,*rchild;
}BiTNode,*BiTree;
Status CreateBiTree(BiTree T)
{
char ch;
scanf("%c",&ch);
if(ch==' ')T=NULL;
else
{
T=(BiTNode*)malloc(sizeof(BiTNode));
if(!T)exit (OVERFLOW);
T->data=ch;
CreateBiTree(T->lchild);
CreateBiTree(T->rchild);
}
return OK;
}
Status PreOrderTraverse(BiTree T)
{if(T)
{
printf("%c",T->data);
PreOrderTraverse(T->lchild);
PreOrderTraverse(T->rchild);
}
return OK;
}
Status DestroyBiTree(BiTree T)
{if(T)
{
PreOrderTraverse(T->lchild);
PreOrderTraverse(T->rchild);
free(T);
}
return OK;
}
void main()
{
BiTree T;
T=(BiTNode*)malloc(sizeof(BiTNode));
CreateBiTree(T);
PreOrderTraverse(T);
DestroyBiTree(T);
}