R
ritchie
Hi all,
I am new to this group and I have question that you may be able to
help me with.
I am trying to learn C but am currently stuck on this.
First of all, I have a function for each sort (Bubble, insertion,
selection..).
I have an array of int's and am passing them to each sort function.
My problem is that the fist time I pass the array it is sorted fine,
but when I pass the array a second time (to the next sort function) it
is (obviously) already sorted.
I want to be able to keep the original values of the array (un-sorted)
for each function call and then sort the array each time, with each
sort routine.
Does anyone know how I can do this??
I have tried but keep getting it wrong and it is really irrating me!
I know I should use pointers to pass the array, but this is where I am
stuck.
I'd really aprechiate any help.
Thanks in advance,
Ritchie.
I am new to this group and I have question that you may be able to
help me with.
I am trying to learn C but am currently stuck on this.
First of all, I have a function for each sort (Bubble, insertion,
selection..).
I have an array of int's and am passing them to each sort function.
My problem is that the fist time I pass the array it is sorted fine,
but when I pass the array a second time (to the next sort function) it
is (obviously) already sorted.
I want to be able to keep the original values of the array (un-sorted)
for each function call and then sort the array each time, with each
sort routine.
Does anyone know how I can do this??
I have tried but keep getting it wrong and it is really irrating me!
I know I should use pointers to pass the array, but this is where I am
stuck.
I'd really aprechiate any help.
Thanks in advance,
Ritchie.