So I have an error, I pinpointed it to this function. Nothing else seems to be the problem.
full error line:
word_driver.obj : error LNK2001: unresolved external symbol "public: class WORD & __thiscall WORD::operator=(class std::basic_string,class std::allocator > const &)" (??4WORD@@QAEAAV0@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
WORD us;
us = "abc";
cout<<"Testing operator= by assignment the value of \"abc\" to use\n";
cout<<us;
class WORD
{
public:
WORD & operator=(const string &);
WORD & operator=(const WORD &);
private:
void AddChar(char);
alpha_numeric *front;
};
WORD & WORD::operator=(const WORD & org)
{
alpha_numeric *p;
if (this != &org)
{
if (!Is_Empty())
{
while(front != 0)
{
p = front;
front = front->next;
delete p;
}
}
for(p = org.front; p!=0; p=p->next)
{
AddChar(p->symbol);
}
}
return *this;
}
operator=(WORD const &)
not operator=(const string &)`. That is the one you need to study, not the string one. - Raymond Chenoprator=(string const &)
is missing. Are you deleting one method when you add the other? Your declared both, you need to write both. Please stop changing the question. It invalidates previous answers. - Raymond Chen