Computers and Technology

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 pointer p becomes a dangling pointer.

B. the compiler will automatically deallocate the memory pointed to by p.

C. the program will suffer from memory leaks.

D. the returning function will throw the bad_alloc exception.

E. None of these

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, mikey3882
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
image
Computers and Technology, 22.06.2019 21:30, Nathaliasmiles
The graph shows median weekly earnings for full-time workers according to education level. which can you not conclude?
Answers: 2
image
Computers and Technology, 23.06.2019 09:00, opgbadwolf5
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
image
Computers and Technology, 23.06.2019 09:10, babyskitt
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
Do you know the correct answer?
Suppose that a function dynamically allocates a block of memory with a local pointer variable p poin...

Questions in other subjects: