malloc array declaration in c code example
Example 1: malloc int array c
int array_length = 100;
int *array = (int*) malloc(array_length * sizeof(int));
Example 2: c malloc array
#define ARR_LENGTH 2097152
int *arr = malloc (ARR_LENGTH * sizeof *arr);
Example 3: how to use malloc in c
ptr = (castType*) malloc(size);