令牌错误之前'{'预期类名
expected class-name before '{' token error
在我的c++中,我得到了错误"在'{'令牌之前预期的类名"。我试图将avlTree类继承为单词搜索类,但它不工作。
#ifndef WORDSEAR_H
#define WORDSEAR_H
#include <string>
#include "avlTree.h"
class wordSearch: public avlTree
{ <----error right here
public:
//functions are here
private:
};
#endif
这是avlTree.h
#ifndef AVLTREE_H
#define AVLTREE_H
template <class myType>
struct nodeType {
myType keyValue;
nodeType<myType> *left;
nodeType<myType> *right;
};
template <class myType>
class avlTree
{
public:
//functions are here
private:
};
#endif
avlTree
是一个类模板,您需要为它指定模板参数:
class wordSearch: public avlTree<something>
根据您的意图,您也可以制作wordSearch
类模板:
template <typename myType>
class wordSearch: public avlTree<myType>
相关文章:
- holeMenuProgram.cpp:38:1 错误:'}'令牌之前的预期主表达式
- Arduino 用于语句错误。令牌之前的预期')' ';'。如何解决这个问题?
- 错误:令牌 { '{' 之前应存在非限定 ID
- "错误 C0000:语法错误,令牌"<EOF>"处出现意外$end,并且不确定
- (错误:令牌之前'<<'预期的主表达式)
- 令牌 C++ 错误之前'['非限定 ID
- 修复令牌错误之前';'预期的非限定 ID
- 是什么导致了构造函数之后的这些"意外令牌"错误?
- 插入protobuf时SQLite无法识别的令牌错误:要处理哪些令牌以及如何处理?
- 获取语法和意外令牌错误,任何人都知道原因
- 令牌"("错误之前缺少 QT 二进制运算符
- 声明cudaError_t变量时出现无法识别的令牌错误
- CFtpConnection::GetCurrentDirectory未解析的令牌错误.不过,像SetCurrentDi
- 令牌错误之前"{"预期类名
- 令牌错误之前的预期主表达式'<'
- “{”令牌错误前预期的非限定id
- 令牌错误之前'{'预期类名
- 文件RecvFile函数中预期的令牌错误
- 令牌错误之前应为不合格的id
- Visual Studio 2010 + CUDA 4:尝试使用NPP分配内存时出现无法识别的令牌错误