IN C LANGUAGE (10 points) Beunding Velume Restring Assuming that your alloeation
ID: 3904389 • Letter: I
Question
IN C LANGUAGE
(10 points) Beunding Velume Restring Assuming that your alloeation will not fail e you don't need to check foe NULL pointers) write a method that resizes a 3 dimensional amay whose 12 andions are the coondinate, the y coordinate, and the indices of overlapping ones (respectively) You will only resize on the y coordinate.Fill any newly allocated values with IMPOSSIBLE intreeieY(int eurx, int oldy, int nevr, int curoverlap, int board) int 1, 3. ntret, 1/ In case you don t want to use board /7 Your Code hereExplanation / Answer
int ***resize(int curx, int oldy, int newY, int overlap, int ***board){
int *** array = (int ***)malloc(curx*sizeof(int**));
for (i = 0; i< curx; i++) {
array[i] = (int **) malloc(newY*sizeof(int *));
for (j = 0; j < newY; j++) {
array[i][j] = (int *)malloc(overlap*sizeof(int));
}
}
for (int i = 0; i<curX; i++){
for (int j = 0; j<oldY; j++){
for (int k = 0; k<overlap; k++){
array[i][j][k] = board[i][j][k];
}
}
}
board = array;
return board;