________ pointer arises when you use the address of an object after its lifetime is over.

________ pointer arises when you use the address of an object after its lifetime is over.

  • (a) Null
  • (b) Smart
  • (c) Dangling
  • (d) Both a and c
  • Dangling Pointer: A dangling pointer arises when a pointer holds the memory location of an object that has already been freed, deleted, or gone out of scope. This means that the lifetime of that object has ended, and as a result, the memory location may be reclaimed by the system or allocated to another object. Accessing or using that memory location leads to undefined behavior, such as crashes or garbage data.
Facebook
WhatsApp
Related MCQs:

 ‘NATO’ is an abbreviation of:

  • (A) North Atlantic Treaty Organization
  • (B) Non-Aligned Treaty Organization
  • (C) Non-Aligned Trading Organization
  • (D) North American Transport Organization

You May Like

Comment

You cannot copy content of this page

Scroll to Top