Consider the following sequence of operations:
- Pointer p1 is set to point at a new heap-dynamic variable.
- Pointer p2 is assigned p1’s value
- The heap dynamic variable pointed to by p1 is explicitly de-allocated but p2 is not changed by the operation
This situation leads to which of the following:
- p1 becomes a dangling pointer
- p2 becomes a dangling pointer
- Both p1 and p2 are now dangling pointers
- Neither p1 nor p2 is now a dangling pointer