从已有的文件中的二叉树的前序遍历序列为 ABC##DE#G##F###,创建二叉树
template <class T> void BinaryTree<T>::CreateBinTree (ifstream& in, BinTreeNode<T> *subTree)
{
T item;
if(!in.eof())
{
in>>item;
if(item!=RefValue)
{
subTree=new BinTreeNode<T>(item);
if(subTree==NULL)
{cerr<<"存储分配错误!"<<endl;exit(1);}
CreateBinTree(in,subTree->leftChild);
CreateBinTree(in,subTree->rightChild);
}
else
subTree==NULL;
}
}
void main()
{
BinaryTree<char> Bin;
BinTreeNode<char> subTree;
cout<<"第一题:假设某二叉树的前序遍历序列为ABC##DE#G##F###,请构建二叉树。\n";
ifstream in("C\\实验四\\data.txt");
Bin.CreateBinTree(in,subTree);
cout<<"二叉树创建完成.........................\n";
}
error C2664: 'CreateBinTree' : cannot convert parameter 2 from 'struct BinTreeNode<char>' to 'struct BinTreeNode<char> *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
这是什么错误啊!求高手解答啊