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 p 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 p. Then
a. the program will suffer from memory leaks.
b. none of these
c. the compiler will automatically deallocate the memory pointed to by p.
d. the returning function will throw the bad_alloc exception.
e. the pointer p becomes a dangling pointer.
 Suppose that a function dynamically allocates a block of memory with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!