malloc how to use code example
Example 1: allocate memory c
ptr = (castType*)calloc(n, size);
Example 2: how to free memory in c
int *example = NULL; //create pointer
example = malloc(sizeof(int)); //allocate memory
free(example); //deallocate memory