hello everyone,
I was wondering if there is way to sort two different arrays of different data types without struct's.
For example lets say you have an array of doubles that represent rainfall for each month of the year. [0] representing January's rainfall amount, etc... Then I have an array of char's with the names of the months. [0] representing "January". Now I sort the rainfall in descending order, how do I get the char array to stay in sync with the rainfall array. I was planning on using a selection method to sort the rainfall amounts, but I can't pass it a double array and a char array.
I know I could create another array of int's and use a selection method to sort rainfall and int's 1-12 to represent the months. Then I could pass this to a switch statement or loop to display the months rainfall. This way seems to show my inexperience. I know there has to be a way to sort them without any special libs.
thanks for your time,
Brad