Esempio n. 1
0
//preconditions: inputWord is not null
//postconditions: 1 if src == inputWord.getSrc(), 0 otherwise
//description: equality overloaded operator
bool word::operator==(word& inputWord) const
{
	if(src.compare(inputWord.getSrc()) == 0) //check if src is the same as inputWord's src
	{
		return true;
	}
	return false;
}
Esempio n. 2
0
//preconditions: inputWord is not null
//postconditions: 0 if inputWord is greater than "this", 1 if less than "this"
//description: less than overloaded operator
bool word::operator<(word& inputWord) const
{
	if(src.compare(inputWord.getSrc()) < 0) //check if source less than inputWord
	{
		return true;
	}
	return false;
}