I have 4 sorted integer arrays, which i'm trying to merge into one huge sorted array.
I merge A and B together which gives me another int array called X Then I merge C and D together which gives me another int array called Y Finally i merge X and Y together to get Z, which is the final product.
The merge function is doing exactly the same each time, just storing the results into a different array which i want to pass in by reference.
I want to do something like this:
void mergeSort(int arr1[], int arr2, int &result[]){
...
}
But i get the error "Array of reference is not allowed". What is the best way to do this?