what is smart pointer & use of the smart pointer ???
Answer Posted / satya
Smart pointers are objects which store pointers to
dynamically allocated (heap) objects. They behave much like
built-in C++ pointers except that they automatically delete
the object pointed to at the appropriate time. Smart
pointers are particularly useful in the face of exceptions
as they ensure proper destruction of dynamically allocated
objects. They can also be used to keep track of dynamically
allocated objects shared by multiple owners.
Is This Answer Correct ? | 16 Yes | 0 No |
Post New Answer View All Answers
Are strings immutable in c++?
Is c++ the hardest programming language?
What is encapsulation in C++? Give an example.
What is the difference between public, private, and protected access?
Why c++ is the best language?
What are the sizes and ranges of the basic c++ data types?
Can recursive program be written in C++?
What is the difference between reference and pointer?
What are disadvantages of pointers?
Write a C++ Program to check whether a number is prime number or not?
How long will it take to learn programming?
What is the output of the following program? Why?
What is an inline function in c++?
Is c++ primer good for beginners?
What is pure virtual function?