what is smart pointer & use of the smart pointer ???
Answer Posted / 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 |
Post New Answer View All Answers
Why c++ is better than c language?
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
Write about the stack unwinding?
Write a note about the virtual member function?
Explain linear search.
Is c++ a programming language?
How do you sort a sort function in c++ to sort in descending order?
What is ostream in c++?
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()
When are exception objects created?
How can you quickly find the number of elements stored in a dynamic array?
Why the usage of pointers in C++ is not recommended ?
Is c++ a high level language?
What is the use of endl in c++?
What is the difference between *p++ and (*p)++ ?