Sorting

Ok I know how to sort an array. That's not what I'm asking. Basically my problem analysis is:

I have to read in a file of employee reports

ie
salesID Employee code numunits numdollars
6022 1 3 100.00
6023 1 6 200.00


ok so I read each value into arrays ( salesID[numemployees], employeecode[numemployees], etc)

Then I have to sort them and outpput to a file.

Here's where I have a problem. if salesID 6022 corresponds with 3 units sold, and I sort by numunits, how will it still have the right salesID with it. I hope my querry makes sense
Make a struct containing all of the fields, then have just one array.

Or, as you sort, you must perform the same swap operations on all arrays.
That's the problem. We haven't learned structures yet. So I can't use them. Even if I knew how I'm not allowed to
Topic archived. No new replies allowed.