I am passing an array to a function to sort it and return the median value. I do not want the global array to be sorted. I only want the array to be sorted within the function. I thought that when a variable was passed to a function, a copy was made for the function. Apparently I am wrong about this??? Thanks, Carroll.
Surely, you are wrong. In C, arrays are passed by reference. Re-read K&R. Regards, M.
"Apparently I am wrong about this" You certainly are! Remember that an array name in 'C' is effectively a pointer. As Michael said, re-read your K&R!