int** new_2D_int_array(int dim1, int dim2) - AmiralBl3ndic/CLib_v2 GitHub Wiki

int** new_2D_int_array(int dim1, int dim2)

This function allocates a 2 dimensionnal integers array

You do not need to check the allocation of your pointer with this function


Warning

Using this function may cause the program to stop if a problem occurs with allocation, due to use of function void check_alloc(void* p)


Parameters:

  • int dim1: the number of sub-arrays
  • int dim2: the size of sub-arrays

Return values:

  • pointer on two dimensionnal int array (int**)

Example:

//Simple allocation, creates an array of 5 sub-arrays of 10 integers
int** myArray1 = new_2D_int_array(5, 10);