So I have a two dimensional dynamic array and I have to resize it. After I resize it the compiler says that it can't access the memory trough a format like this: array[i][j]
void resize(int **array,int newsize,int size){
int newarraysize=WINDOWY/newsize;
int arraysize=WINDOWY/size;
array= (int**)realloc(array,(newarraysize*sizeof(int*)));
if(newarraysize>arraysize){
for(int i=0; i<arraysize; i++)
array[i]=(int*)realloc(tomb[i],(newarraysize*sizeof(int)));
}
else{
for(int i=0; i<newarraysize; i++)
array[i]=(int*)realloc(tomb[i],(newarraysize*sizeof(int)));
}
printf("\n");
for(int i=0;i<newarraysize;i++)
{
for(int j=0;j<newarraysize;j++)
printf("[%d][%d]: %p ",i,j,&array[i][j]);
printf("\n");
}
}