what is smart pointer & use of the smart pointer ???
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / swarna sekhar dhar
Smart pointers have been the subject of hecatombs of code
written and rivers of ink consumed by programmers and
writers around the world. Perhaps the most popular,
intricate, and powerful C++ idiom, smart pointers are
interesting in that they combine many syntactic and semantic
issues. This chapter discusses smart pointers, from their
simplest aspects to their most complex ones and from the
most obvious errors in implementing them to the subtlest
ones—some of which also happen to be the most gruesome.
In brief, smart pointers are C++ objects that simulate
simple pointers by implementing operator-> and the unary
operator*. In addition to sporting pointer syntax and
semantics, smart pointers often perform useful tasks—such as
memory management or locking—under the covers, thus freeing
the application from carefully managing the lifetime of
pointed-to objects
| Is This Answer Correct ? | 2 Yes | 1 No |
What is vectorial capacity?
write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num
What are the differences between a struct and a class in C++?
What is the difference between delegation and implemented-in-terms-of?
Is string data type in c++?
How is computer programming useful in real life?
What is a singleton class c++?
What is buffering in c++?
What are the conditions that have to be met for a condition to be an invariant of the class?
What is the first name of c++?
Friend functions can access private and protected members of a class.
What is a lambda function c++?