i cant think of a good way to do this, if i was to have an integer array of 10 different random integers, then i want to put them in order in a dfferent array how would i go about doing this?
i cant think of a good way to do this, if i was to have an integer array of 10 different random integers, then i want to put them in order in a dfferent array how would i go about doing this?
Look into sorting methods, this is a common topic, do a board search
If you want to learn how to code a sort, then definitely search for appropriate techniques. If this just needs to get done, use std::sort in <algorithm>.
The classic simple method is a bubble-sort. Note that a bubble-sort does not sort the values into a new array. It uses a single temporary variable to allow you to swap two values at a time in the original array.
Whatever method you use, you will have to loop-through the array multiple times.
If you write your own algorithm (such as simply looking for the lowest value, then the next-lowest value) make sure you can handle duplicate values in the array.