error C2440: '=' : cannot convert from 'struct BiNode *' to 'int'
voidBiTree::LeverOrder(){intQ[200];front=rear=-1;if(root==NULL)return;Q[++rear]=root;...
void BiTree::LeverOrder()
{
int Q[200];
front=rear=-1;
if(root==NULL)return;
Q[++rear]=root;
while(front!=rear)
{
q=Q[++front];
cout<<q->data;
if(q->lchild!=NULL)Q[++rear]=q->lchild;
if(q->rchild!=NULL)Q[++rear]=q->rchild;
}
}
error C2440: '=' : cannot convert from 'struct BiNode *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2227: left of '->data' must point to class/struct/union
error C2227: left of '->lchild' must point to class/struct/union
error C2227: left of '->lchild' must point to class/struct/union
error C2227: left of '->rchild' must point to class/struct/union
error C2227: left of '->rchild' must point to class/struct/union 展开
{
int Q[200];
front=rear=-1;
if(root==NULL)return;
Q[++rear]=root;
while(front!=rear)
{
q=Q[++front];
cout<<q->data;
if(q->lchild!=NULL)Q[++rear]=q->lchild;
if(q->rchild!=NULL)Q[++rear]=q->rchild;
}
}
error C2440: '=' : cannot convert from 'struct BiNode *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2227: left of '->data' must point to class/struct/union
error C2227: left of '->lchild' must point to class/struct/union
error C2227: left of '->lchild' must point to class/struct/union
error C2227: left of '->rchild' must point to class/struct/union
error C2227: left of '->rchild' must point to class/struct/union 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询