int *merge (int *array1, int *array2){
int iL = sizeof(array1)/sizeof(int);
int jL = sizeof(array2)/sizeof(int);
printf ("%d, %d\n", iL,jL);
int *mergeList = (int*)malloc((iL + jL) *sizeof(int));
int i=0,j=0,k=0;
while (i < iL && j < jL){
if (array1[i]<array2[j]){
mergeList[k++] = array1[i++];
}
else{
mergeList[k++] = array2[j++];
}
}
while (i < iL){
mergeList[k++] = array1[i++];
}
while (j<jL){
mergeList[k++] = array2[j++];
}
return mergeList;
}
so the two lists entering the method is
list1 [6] = {2,-1,0,3,1,6};
list2 [2] = {-6,-10};
but for some reason, when they method prints out the length of each input arrays, the output: 2,2. I have been stuck with this for 2 hours...