...
Declare a pointer variable named
arrayPtr
and dynamically allocate memory for an array of 5 integers using thenew
operator.Assign values to the array elements (e.g., 1, 2, 3, 4, 5).
Print the values of the array elements using the pointer.
Deallocate the memory using the
delete[]
operator and setarrayPtr
tonullptr
.Print a message confirming the memory deallocation.
Use the following code starter to complete your lab. Please make sure you add the C++ code under the pseudo-coded instructions:
...