See All Responses Below...
Smart pointer is one of the best
option in C++ when it comes to deleting the pointer automatically after its scope. For example most of the COM / ATL libraries based applications uses smart
pointers extensively in development. For more information about smart pointer please see the link below..