how to do dynamic memory allocation in c code example
Example 1: c allocate array
int *array = malloc(10 * sizeof(int));
Example 2: free in c
the C library function void free(void *ptr)
deallocates the memory previously allocated by a call to calloc, malloc, or realloc.