Which of the following C++ standards introduced smart pointers?
- C++03
- C++11
- C++14
- C++98
Smart pointers, like std::shared_ptr, std::unique_ptr, and std::weak_ptr, were introduced in C++11. They are part of the C++ Standard Library and are designed to manage the lifecycle of dynamically allocated objects, preventing memory leaks.
Loading...
Related Quiz
- Consider a scenario where you have a large dataset and you need to frequently erase and insert elements in the middle of the data. Which STL container should be avoided in order to prevent frequent reallocations and data movements?
- When a class contains a pointer to memory allocated in class, we should define a _______.
- Which STL container provides constant time access to elements but may take linear time to insert a new element?
- To prevent a class from being inherited, we declare it as _______.
- How does the goto statement alter the flow of control in a C++ program?