Main advantage of shared_ptr is that it automatically releases the associated memory when not used any more.
We should create shared_ptr objects carefully. Checkout below two cases,
In comparison to a raw pointer, shared_ptr provides only these operators
By default shared_ptr calls the,
shared_ptr is a kind of Smart Pointer that is smart enough to automatically delete the associated pointer when its not used anywhere. Thus helps us to completely remove the problem...