Shared Pointers

Hi All,
I tried to searh online regarding shared pointers and I read a lot that they avoid memory leak.

When smart pointers can make sure that they can avoid memory leak...why do we need these shared pointers?

Are both smart pointers and shared pointers same?

I have implemented smart pointers and no idea about shared pointers.

Please share one small program that emphasize the use of shared pointers.

Thanks a lot in advance
Shared pointers are a type of smart pointer - probably the most commonly-used type.

There are other types of smart pointer, too, that enforce different ownership paradigms.
Can you please share an example program using a shared pointer?


Thanks in advance
Prasad
Topic archived. No new replies allowed.