If a pointer to an object is created and the object gets deleted without using the pointer then __________

Phạm Quyết

New member
If a pointer to an object is created and the object gets deleted without using the pointer then __________
A. It becomes void pointer
B. It becomes dangling pointer
C. It becomes null pointer
D. It becomes zero pointer
 
Answer: b
Explanation: When the address pointed by the object pointer gets deleted, the pointer now points to an invalid address. Hence it becomes a dangling pointer. It can’t be null or void pointer since it doesn’t point to any specific location.
 

Tìm kiếm

Back
Top