I'm new to C programming and wonder if there is a way to prevent changing the values of an array.
I have an array:
int *array = makeArray();
Then I apply a sorting method to this array:
sortingMethod1(array);
When I call:
sortingMethod2(array);
The list is already sorted and I have no way of benchmarking the second sorting method.
I'd like to know if there is a way of passing the same array to both functions without sorting it for the next function.
If anyone could help me with what seems to be a very simple question I would appreciate it.
malloc()? Does it just return astaticvariable?