Sorting variable names by their values.

Hello there!

What I have here is about 20 variables with more or less different numeric values, and I should somehow sort them from largest to smallest, and return the variable names of three largest values.

Now I have been digging around arrays and hashtables, but I am not sure if these are appropriate for this purpose. I dont seem to have any clue where to start solving this problem, and I would appreciate any pointer to help get back on the right track.

Thank you in advance!

The .NET library includes various sorting functions (e.g. Array.Sort()) that you can use to sort a container based on specified criteria, and this is probably what you'd want to use. (I'm not sure what you mean about returning the 'names' of the variables, but whatever it is you want to do, you should be able to accomplish it using a 'sort' function and perhaps a custom struct or class.)

This works if you are interested http://www.youtube.com/watch?v=3560eDQ8shw