c++编写放大器,将结点值放入N的时候报错
typedef struct element
{
char N;
int D;
int d;
bool boost;
}element;
//定义二叉树
typedef struct bitnode
{
struct element data;
bitnode lchild, * rchild;
}bitnode, * bitTree;
//创建二叉树
void createbitTree(bitTree &T)
{
char c;
int a;
c = getchar();
if (c == '#')T = nullptr;
else
{
scanf_s("%d", &a);
T = (bitnode*)malloc(sizeof(bitnode));
if(T ==nullptr)exit(-1);
T->data->N = c;
T->data->d = a;
T->data->boost = false;
T->data->D = 0;
T->lchild = T->rchild = nullptr;
createbitTree(T->lchild);
createbitTree(T->rchild);
}
}
请大家帮帮忙到底哪里有问题