Access Dynamic Memory
Dynamic memory behaves like an array, with its data type specified by the type of the pointer.
As with arrays, to access an element in dynamic memory, refer to its index number:
ptr[0] = 12;
You can also dereference the pointer to access the first element:
*ptr = 12;