So arrays are not my strong point and once again I call upon this forum.
The output of the code should look something like this:
6 10 20 5 30 15 25
The original numbers are:
[0] 10
[1] 20
[2] 5
[3] 30
[4] 15
[5] 25
The sorted numbers are:
[0] 5
[1] 10
[2] 15
[3] 20
[4] 25
[5] 30
//
using the sort function we take an array and output the original numbers then output the numbers sorted. So far all we've managed to do is get wild answers or none at all.
Well since you're using namespace std and including <algorithm> you need to name your "sort" function something else. There is already a function named sort in the standard namespace and prototyped in <algorithm>.
Second your "swap" looks incorrect. You may want to review your documentation for your sort. What type of sort are you trying to accomplish?
This is literally all he gave us to work with. And I'm getting most of the function code from a classmate who's taken this class before. We're struggling.