top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C++ : What is smart pointer and how does it work ?

+3 votes
484 views
C++ : What is smart pointer and how does it work ?
posted Mar 26, 2016 by Ganesh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Smart pointer (as opposed to a "dumb" or "raw" pointer) is a C++ structure that behaves almost identically to a common C pointer but it also includes some other capabilities, e.g. throws an exception when it's NULL and someone tries to dereference it, or it destroys its contents automatically when it goes out of scope.

Please Click here for more info

answer Mar 28, 2016 by Manikandan J
Similar Questions
+2 votes

I know the definition of singleton class i.e. a class for which only one object can be defined or initialized. But I want to know all the possible ways to achieve this restriction.

0 votes

While doing design for a software, what things enforce to use template classes and template functions ?
Is it consider best practices or not ?

...