--:--









Quiz for Smart pointers introduction

Course: C++ Language | Subject: Unit 8 | Topic: Pointers and Dynamic Memory Management



Logo

Q1: What is a smart pointer in C++?

Logo

Q2: Which header file is required to use smart pointers?

Logo

Q3: Which of the following is NOT a standard smart pointer?

Logo

Q4: What is the main feature of unique_ptr?

Logo

Q5: Which smart pointer allows multiple owners?

Logo

Q6: What is the purpose of weak_ptr?

Logo

Q7: Can unique_ptr be copied?

Logo

Q8: How do you create a unique_ptr?

Logo

Q9: Which smart pointer does not increase reference count?

Logo

Q10: What happens when the last shared_ptr to an object is destroyed?

Logo

Q11: Which smart pointer can be used to check if the object still exists?

Logo

Q12: What is the advantage of smart pointers over raw pointers?

Logo

Q13: Which smart pointer type is deprecated in C++11?

Logo

Q14: How do you access the raw pointer from a smart pointer?

Logo

Q15: Can smart pointers be used with arrays?

Logo

Q16: What happens if you reset a smart pointer?

Logo

Q17: Which smart pointer is best suited for exclusive ownership?

Logo

Q18: Can you assign a unique_ptr to a shared_ptr?

Logo

Q19: What is the key difference between shared_ptr and weak_ptr?

Logo

Q20: Which smart pointer type helps prevent memory leaks due to circular references?

Are you ready to start test? Set your time limit