コード例 #1
0
ファイル: Name.cpp プロジェクト: dweitz/Blue-Jay
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
ファイル: Name.cpp プロジェクト: dweitz/Blue-Jay
bool operator<(const Name& first, const Name& second)
{
	return (first.getName() < second.getName());
}
コード例 #4
0
ファイル: phonebook.cpp プロジェクト: bds105/myrepo
// Define a "less than" operator for comparison: used for hashing
bool operator<(Name a, Name b)
{
    return strcmp(a.getName(), b.getName())< 0;
}