how to assign contiguous dynamic memory in c++ code example Example: allocate memory c ptr = (castType*)calloc(n, size);