Hi. Im working with a cstring function that is supposed to compare the values of two strings, MyString and m2. I have #include so its definitely not that. these are my errors.
(74) : error C2275: 'MyString' : illegal use of this type as an expression
(74) : error C2660: 'MyString::length' : function does not take 1 arguments
(76) : error C2275: 'MyString' : illegal use of this type as an expression
and this is the code that I am getting them from.
bool MyString::operator ==(const MyString &m2) const
{
int temp = 0;
if (length(MyString) = length(m2)) // 74
{
if (strcmp(MyString, m2)) // 76
{
temp = 1;
}
else
{
temp = 2;
}
}
if(temp = 2)
{
return "true";
}
else
{
return "false";
}
}
Any help on this would be appreciated, thanks.