Hi,
I am trying to overload the != in my method. I am not getting any errors in my program, but my output is just not coming up. Basically, I just want my cout to work and I really don't care about != in my coming up with anything but true right now, cause I know i can alter it later. Thanks for any help anyone can offer me.
Here is my code:
Code:
//in my main:
if (test != test2) cout << "They are equal" << endl;
else cout << "They are not equal" << endl;
//in my header:
bool operator!=( const StringList &right ) const;
//in my class
bool StringList::operator!=(const StringList& s2) const{
return true;
}
Basically, the words They are equal and They are not equal are not showing up, even though They are equal should always appear as the != always returns true.
Thanks again for any help anyone could offer me.