Which of the following are potential problems when we use the delete operator on a pointer variable?

a. inaccessible heap memory
b. dangling pointers
c. uninitialized pointers
d. NULL pointers


b) Dangling pointer
Explanation:
A dangling pointer occurs when several pointers point to the same allocated memory, and one of the pointers has the delete operator applied to it. The memory is still there, but it now belongs to the free store manager. The remaining pointers point to deleted memory and are called are dangling. It is common to speak of the deleted pointer as dangling as well, but it might or might not still be pointing at the deleted memory. It is at best an error to delete a pointer that points to already deleted free store memory, and at worst a disaster.

Computer Science & Information Technology

You might also like to view...

Which of the following cannot be changed using the Handout master page?

A) The location of fields on the page B) Where the thumbnails appear on the page C) How many thumbnails are on the page D) The orientation of the page

Computer Science & Information Technology

The ____ Index Scans feature allows simultaneous full-index scans and reads of data blocks, increasing the response times for data manipulation and retrieval.

A. Full B. Complete C. Concurrent D. Parallel

Computer Science & Information Technology

How many wired and/or wireless computers and mobile devices might a router be able to connect?

A. more than 200 B. more than 450 C. more than 500 D. There is no limit.

Computer Science & Information Technology

What should you do while copying data on a suspect's computer that is still live??

A. ?Open files to view contents. B. ?Make notes regarding everything you do. C. ?Conduct a Google search of unknown extensions using the computer. D. ?Check Facebook for additional suspects.

Computer Science & Information Technology