Selection Sort

Dear all,

In the selection sort as in the link below:

http://www.fredosaurus.com/notes-cpp/algorithms/sorting/selectionsort.html

Apparently the array x[] being sorted is changed in the process. So how come in the function title it is declared as int x[] but not int& x[]?

Many thanks.

Regards,
Bosco
x is just a pointer to the first element in the array. The first row is completely equivalent to
void selectionSort(int* x, int n) {
Topic archived. No new replies allowed.