In a real-time gaming application written in C++, which smart pointer would you choose to manage instances of game objects, assuming the objects need to be shared across multiple game scenes? 

  • auto_ptr 
  • weak_ptr 
  • shared_ptr 
  • unique_ptr
shared_ptr allows multiple pointers to share ownership of the same object. This ensures that the object remains alive as long as there's at least one shared_ptr pointing to it, which is ideal for shared resources in games.
Add your answer
Loading...

Leave a comment

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