Question: Suppose that a function dynamically allocates a block of memory with a local pointer variable p pointing to the allocated block. Suppose further that there
Suppose that a function dynamically allocates a block of memory with a local pointer variable pointing to the allocated block. Suppose further that there are no other pointers referencing that block of memory, and the function returns without doing a delete on Then
a the program will suffer from memory leaks.
b none of these
c the compiler will automatically deallocate the memory pointed to by
d the returning function will throw the badalloc exception.
e the pointer becomes a dangling pointer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
