Sorting arrays with mixed elements
Posted: Tue Jun 15, 2010 2:10 pm
Hi,
I have an array with the following structure: char char integer.
I mean, when I print it get these example results:
POL LIPA 18
USA JOHNSON 21
FRA LIERRE 14
So, I would like this list to be sorted from the highest INT variable to the lowest, so I would get:
USA JOHNSON 21
POL LIPA 18
FRA LIERRE 14
I was able to use sort(); with arrays with the elements of same type but I think it wont work here?
Thanks for all help.
I have an array with the following structure: char char integer.
I mean, when I print it get these example results:
POL LIPA 18
USA JOHNSON 21
FRA LIERRE 14
So, I would like this list to be sorted from the highest INT variable to the lowest, so I would get:
USA JOHNSON 21
POL LIPA 18
FRA LIERRE 14
I was able to use sort(); with arrays with the elements of same type but I think it wont work here?
Thanks for all help.