How to sort a matrix?

The user enters the values of the matrix, for example
5 6 8 9
7 4 5 1
8 5 6 12
You need to rearrange columns by increasing the value of the last element of the column, that is
6 8 5 9
4 5 7 1
5 6 8 12
I need at least an idea how it can be implemented, and that the head did not go
March 19th 20 at 08:56
1 answer
March 19th 20 at 08:58
I need at least an idea how it can be implemented

It is possible to realize the function qsort. The matrix stored by columns rather than rows.

Find more questions by tags ArraysC