Question: Which smart pointer should be used when you want a reference counted pointer? Select one. std:iweak_ptr std::counted_ptr std:ref_ptr std::shared_ptr Question 2 (5 points) Why would
Which smart pointer should be used when you want a reference counted pointer? Select one. std:iweak_ptr std::counted_ptr std:ref_ptr std::shared_ptr Question 2 (5 points) Why would you create a smart pointer using std:make_unique0 or std::make_shared 0 instead of using new A0? Select one. They do not throw exceptions, so the smart pointer instance is valid even if the pointer is nullptr. They get memory that will be garbage collected: The functions do not exist. They allocate memory using a pool. Question 3 (5 points) What is a dangling pointer? Select one. A pointer that has been deleted but not set to nullptr A pointer hanging off a cliff A pointer to a stack variable A pointer to a memory address of some variable or memory that has been deleted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
