-4
bool sortingGame(Player Player1, Player Player2)
{
if (Player1.gamePercent() > Player2.gamePercent())// first compare precetage (float)
{
return true;
}
else if (Player2.gamePercent() > Player1.gamePercent())
{
return false;
}
else if (Player1.getLastName() > Player2.getLastName())//then names (std::string)
{
return true;
}
else if (Player2.getLastName() > Player1.getLastName())
{
return false;
}
else if (Player1.getFirstName() > Player2.getFirstName())
{
return true;
}
else
{
return false;
}
}
繼承人++時無效操作者<:下,使用在main()排序
排序(Players.begin(),Players.end(),sortingGame);
這是在Visual Studio中調試時顯示的錯誤。
Program:C:\.....\include\algorithm
Line:3014
Expression: invalid operator<
什麼行是3014,究竟是什麼? – Dai 2015-02-11 01:29:16
不確定...它在#include –
PinesF
2015-02-11 01:33:43
'main()'迭代器中是'Player1'和'Player2'嗎? – ikh 2015-02-11 01:36:32