【发布时间】:2016-04-04 00:58:12
【问题描述】:
当我在不同的函数上设置可变长度 const 时,不知道为什么这个函数会发生错误
int list::length() const {
return length;
}
上面的CPP文件
下面是头文件
class list {
private:
struct Node
{
int info;
Node *next;
};
int length;
Node *head;
public:
list();
list(const list& otherlist);
~list();
int list::length() const;
};
【问题讨论】:
标签: c++ class linked-list constants