I'm trying to write a function that inputs an array of 65 elements (ArrA) and a two-dimensional array of Nx65 elements (ArrB[N]) and returns the two dimensional array with the one dimensional array appended to the end. I'm keeping track of N in the index ArrB (with the rest of the first row full of -1s). I know I'm going to have to malloc/calloc something, but I'm not sure how to prevent the new value from being a local variable. Any ideas?
Would I need to do something like create a temporary array (ArrC) the size of ArrB, then do
Then just iterate through assigning all of the values of ArrC to it and assign ArrA at the end?Code:ArrB = (int*) calloc( (N+1)*65, sizeof(int));
Sorry, I'm not sure how to make sure ArrB stays a 2D array. Any help is greatly appreciated!