The shared_ptr in C++ uses _______ counting to manage the memory of shared objects. 

  • reference 
  • object 
  • allocation 
  • array
shared_ptr uses reference counting, which means it keeps a count of the number of shared_ptr objects referring to the same memory location. When this count drops to zero (meaning no shared pointers are referring to the object), the memory is automatically deallocated.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *