Пример #1
0
bool operator==(const Name& first, const Name& second)
{
	//printf("first=%s, second=%s", first.getName().c_str(), second.getName().c_str());
	if (first.getName() == second.getName())
	{
		//printf(" both are the same \r\n");
		return true;
	}
	else
	{
		//printf(" they are different \r\n");
		return false;
	}
}
Пример #2
0
int main(){
  Name na;
  na.setName("Dhruv");
  cout<<na.getName()<<endl;
  return 0;
}
Пример #3
0
bool operator<(const Name& first, const Name& second)
{
	return (first.getName() < second.getName());
}
Пример #4
0
// Define a "less than" operator for comparison: used for hashing
bool operator<(Name a, Name b)
{
    return strcmp(a.getName(), b.getName())< 0;
}