ArduinoSort and matrix array, custom comparison function declaration

Hello,
my purpose is to sort a matrix array using this library

ArduinoSort library by Emil Vikström 17 Feb 2017

The IDE is 1.8.7 and Arduino core is 1.6.23

This is my test matrix array but I will use a struct were the first field will be a char[] (all elements with same length) and the second field will be an unsigned int

uint16_t my2dArray[5][2] = {
    {45689, 2},
    {35497, 4},
    {12365, 8},
    {25698, 7},
    {45689, 1}
};

Following the instructions the function should be used in this way

sortArray(my2dArray, 5, firstIsLarger2);

The library uses templates, this is the template that will be used, taken from the error message

// Sort an array with custom comparison function
template<typename AnyType> void sortArray(AnyType array[], size_t sizeOfArray, bool (*largerThan)(AnyType, AnyType));

Now the problem arise because I am a noob in C/C++ and I don't know how to declare my comparison function

These are my attempts followed by the error that I get.

bool firstIsLarger2(unsigned int first[], unsigned int second[])

	deduced conflicting types for parameter 'AnyType' ('unsigned int [2]' and 'unsigned int*')

bool firstIsLarger2(unsigned int first, unsigned int second) 

	deduced conflicting types for parameter 'AnyType' ('unsigned int [2]' and 'unsigned int')

bool firstIsLarger2(unsigned int first[2], unsigned int second[2]) {

 	deduced conflicting types for parameter 'AnyType' ('unsigned int [2]' and 'unsigned int*')

Full code is attached

ArduinoSortTest.zip (2.37 KB)

I suspect you will be much better served by using an array of struct. In addition to making it easier to work out the details you will save some SRAM.

Thank you Coding Badly,
you were right!
I used this struct and array declaration

struct FileScore {
  char filename [11];
  uint16_t score;
};

FileScore my2dArray[5] = {
  {"FirstFile", 2},
  {"SeconFile", 4},
  {"ThirFile", 8},
  {"FourFile", 7},
  {"SixtFile", 1}
};

then used the function in same way of before

sortArray(my2dArray, 5, firstIsLarger2);

And my comparison function

bool firstIsLarger2(FileScore first, FileScore secondo) {
  if (first.score > secondo.score) {
    return true;
  } else {
    return false;
  }
}

You are welcome.

zoomx:
And my comparison function

bool firstIsLarger2(FileScore first, FileScore secondo)

That will result in the two structures being copied for each call to firstIsLarger2. If this prototype works use it instead...

bool firstIsLarger2(FileScore & first, FileScore & secondo)

If not, try using pointers (with the necessary modification to the code)...

bool firstIsLarger2(FileScore * first, FileScore * secondo)

Finally, if you do have to use pointers try correctly defining them...

bool firstIsLarger2(FileScore const * const first, FileScore const * const secondo)

Thanks again, pointers will be the next step.
But I believe I have to change the template, adding a new one with pointers.