So, for some reason I tried posting this in the beginners forum, but it wouldn't let me. So I'll post it here.
I am trying to sort a 2D array via selection sort, and before I am hounded about the inefficiency of a selection sort on the amount of data I am sorting, this is a class assignment.
My code will run, but it doesn't sort the array. I am trying to sort the array in ascending order by column 1. I have read the input from a text file which consists of an interger ID # and a double sales price.
I've also tried using nested for loops to do this and it will change my output, but it doesn't sort it. So I just deleted the outer for loop in the sort function.
The first thing I would recommend is getting rid of your global variables. Make them local to the functions or pass them as parameters. Once you do that, I think the problem will be more obvious to you.