//GramDictOrder.h:
#include "StrComp.h"
class GramDictOrder : public StrComparator
{
public:
GramDictOrder(int q, int length, int bSize, int mBit);
private:
......
}
//GramDictOrder.cpp:
GramDictOrder::GramDictOrder(int q, int length, int bSize,int mBit) : StrComparator(length){
......
}
//实例化:
StrComparator* strcomp;
strcomp = new GramDictOrder(gramSize, MAXLEN, bucketSize, maxBit);
头文件放类结构声明,源文件放函数定义,一直不明白为什么会有 : StrComparator(length) 现在终于清楚了:)