Question with Sorting Arrays

Hey guys, I pretty much have all of this program finished, but I'm having some difficulty with the last part. I need to build an array with a random amount of random double values, print it, and then print it again but with all of the random values sorted in ascending order.

I have the array built and am able to print it correctly. However, when I try to sort the array in ascending order and print it again it doesn't use the same values and amount of values used previously -- which I need it to do. Instead it creates another random amount of random values.

Any help at all would be really awesome! Thank you!
Last edited on
In sortArray, you access outside the boundaries of array.

Also, you should probably pay attention to warnings/errors issued by your compiler.

If you don't want to "build" a new array for your sort, don't call buildArray for it.
Topic archived. No new replies allowed.