I’m trying to order an array of arrays by it’s 2nd index, so if I have something like:
a[0][0] = #
a[0][1] = $
a[1][0] = x
a[1][1] = y
a[1][2] = z
a[2][0] = qaz
a[2][1] = qwerty
I get:
a[0][0] = #
a[1][0] = x
a[2][0] = qaz
a[0][1] = $
a[1][1] = y
a[2][1] = qwerty
a[1][2] = z
Thanks in advance!!
This will display the elements in the required order.
You didn’t say what you intend to do with the array elements, but this general idea will work for displaying or printing them in order.