I am struggling to sort a STL list I have created. I have tried using the .sort() function however when I try to compile the program (using visual studio) it gives me a large amount of errors and compilation fails.
At the moment I have the following to go through the list:
I am unsure how to (within the for loop) compare the elements of the list enabling me to sort them, at first I thought they could just be treated like an array (i.e if (array[i] < array[i + 2] )) But clearly this isn't the case.
If someone could point me in the right direction I would be very grateful.