我有一個問題,我不能達到我的頭函數,我想調用它在我的主要功能,但它說。 錯誤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 ); –