So Basically I have a 4 x 2 array of Chars* that I need sorted alphabetically by the first column only. The Array starting out looks like:
Choices[0][0] = "CCleaner";
Choices[0][1] = "Utilities";
Choices[1][0] = "SIW";
Choices[1][1] = "Information";
Choices[2][0] = "MalwareBytes";
Choices[2][1] = "Virus";
Choices[3][0] = "CCleanerx";
Choices[3][1] = "Utilities";
And I need it to be:
Choices[0][0] = "CCleaner";
Choices[0][1] = "Utilities";
Choices[1][0] = "CCleanerx";
Choices[1][1] = "Utilities";
Choices[2][0] = "MalwareBytes";
Choices[2][1] = "Virus";
Choices[3][0] = "SIW";
Choices[3][1] = "Information";
As you can see, alphabetically (ignoring the second columns value).
I'm having a hard time finding what i need to put in its csort call, right now I'm using:
int wxListCtrlComparedecend(const void* first, const void* second)
{
const char **ia = (const char **)first;
const char **ib = (const char **)second;
return strcmp(*ia, *ib);
}
That sorts all items linearly, and I have no clue how to only sort by 1st column.
Thanks in advanced,
-Nathan