帮我看看这段程序哪里出错了2

来源:百度知道 编辑:UC知道 时间:2024/05/30 07:53:48
template<class T>
class chain{
public:
chain() { first=-1;}
~chain() { Destroy();}
void Destroy();
int Length() const;
bool Find(int k,T& x) const;
int Search(const T& x) const;
chain<T>& Delete(int k,T& x);
chain<T>& Insert(int k,const T& x);
void Output(ostream& out) const;
private:
int first;
static space<T>S;
};
template<class T>
void chain<T>::Destroy()
{
int next;
while(first != -1) {
next=S.node[fiest].link;
S.Deallocate(first);
first=next;} }
template<class T>
int chain<

帮我看看这段程序哪里出错了2?

这是2?请问1在哪里?你的代码里面有个space<T>,space在这页里面没有,所以请你贴一下另外一部分的地址

另外,有些错是不看另外一部分也可以的,比如:
int chain<T>::length() const这个函数的定义,你的声明是Length首字母L是大写的,到后面就变小写的,所以是错

又while<index<k&¤t!= -1)这句while后面的左括号,你写成了尖括号。因为你这里拼错,后面很多地方也被认为是错的

好了,先讲这点。你已经是可以先这么多代码的人了,c++语法虽然很多,但这种简单的拼写错误还是应该能够自己发现吧