#include
using namespace std;
typedef struct bitnode
{
char data;
struct bitnode *lchild,*rchild;
}*bitree,tree;
bitree *t;
int number=0;
void createbitree(); //建一个树
bitree createbitree(bitree &t)//这里加&,使用引用,不然函数不会改变t,在主函数里t还会指向空的!
{
char c;
int i=1;
bitree temp=NULL,pre=NULL,s[100];
s[0]=t;
while(1)
{
if (t==NULL)
{
t=new tree;
t->lchild=t->rchild=NULL;
t->data='9';//data 是char型,9是数字,'9'才是字符
cout<data< temp=pre=t->lchild;
break;
}
}
return t;
}
void main()
{
bitree t;
t=0;
createbitree(t);
cout<data< cout<<"the value of the preorder value is:";
}
有问题Hi我哦,亲!