├─◆ 狼盟首页 > 查看贴子 > 详细信息
楼主
问个简单的问题
template <class T>ThrNode<T> *InThrBiTree<T>::Next(ThrNode<T> *p){ ThrNode<T> *q; if (p->rtag==1) q=p->rchild; //右标志为1,可直接得到后继结点 else { q=p->rchild; //工作指针初始化, while(q->ltag==0) //查找最左下结点 q=q->lchild; } return q;}template <class T>void InThrBiTree<T>::InOrder(ThrNode<T> *root){ ThrNode<char> *p; if (root==NULL) return; //如果线索链表为空,则空操作返回 p=root; while(p->ltag==0) //查找中序遍历序列的第一个结点p并访问 p=p->lchild; cout<<p->data; while(p->rchild!=NULL) //当结点p存在后继,依次访问其后继结点 { p=Next(p);//报错 cout<<p->data; }}我是我程序中的两个成员函数p=Next(p);为什么会在这里报错F:xqsC++中序线索二叉树的遍历.cpp(101) : error C2440: '=' : cannot convert from 'struct ThrNode *' to 'struct ThrNode<char> *'应该怎么改下才对呢