how to delete data from pointer code example
Example: how to delete pointer
// deleting pointer allocating an int
int *pointer1 = new int;
delete pointer1;
// deleting pointer allocating an array of ints
int *pointer2 = new int[10];
delete[] pointer2;