To return the memory in our dynamic array example:
delete []v;
C++ will free all the memory allocated for v.
To free the memory allocated by a dynamic struct, for example, a list item as just defined:
delete lst;
Here the operand must be a pointer to a struct.