我有一个问题,我不能达到我的头函数,我想调用它在我的主要功能,但它说。 错误2错误C2039:'测试':不是'std :: basic_string < _Elem,_Traits,_Alloc>' 和未定义的类的成员为什么会发生这种情况? 注意:我删除了代码中不重要的部分。未定义的类,无法从主要到我的标题
#include "CompressHeader.h"
int main()
{ input.get(ch);
string a=ch;
if(Test(a))//here is undefined one.
{
}
我的头
class Compress
{
public:
Compress();
Compress(string hashData[],const int size); //constructor
void makeEmpty();
bool Test(string data);//To test if data in the dictionary or not.
'temp2'从哪里来? – Downvoter
请**用[mcve]或[SSCCE(Short,Self Contained,Correct Example)](http://sscce.org)**您的问题 – NathanOliver
它来自ifstream input.get(ch ); –