You can allocate the whole table in only one array but you won't be able to access array data with indices using two square brackets:
int * temp = malloc(4000*5000*sizeof(int));
to access the element (i,j) where previously you wrote temp[i][j]
, now you should now compute the index the following way:
temp[i*5000+j];
and do not forget to free the memory allocated for your table afterward:
free(temp);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…