【发布时间】:2012-03-17 18:49:36
【问题描述】:
函数定义
const circularLinkedList<Tp>& operator=(const circularLinkedList<Tp>& otherList);
导致错误的行,错误信息是指第 327 行,从 nodeType....开始。
template <class Tp>
nodeType<Tp>* circularLinkedList<Tp>&::operator=(const circularLinkedList<Tp>& otherList)
来自 gcc 编译器的错误信息是:
circularLinkedList.h:327: error: invalid declarator before â&â token
circularLinkedList.h:327: error: expected initializer before â&â token
我假设我在某处定义此方法时出现了某种语法错误。我将如何解决它?谢谢。
【问题讨论】:
-
â&â标记是否只是在奇怪编码的引号中的&标记? -
@MrLister - 我想是的。可能是复制/粘贴问题。
-
这不是 & before ::operator 错误吗?
-
@abresas,这是主要问题。第二个问题是 const circularLinkeList
& 和 nodeType * 之间的类型不匹配。
标签: c++ gcc compiler-errors