Can I get real time use case for using dymamic pointers?

abc abc 351 Reputation points
2022-05-12T06:27:07.657+00:00

Hi,

Generally we would use dynamic pointers when the number of elements to allocate is not known in advance. We can use STL vector/list/set for storing list of objects.

Can I get any use case for dynamic pointers? For e.g. to create log file in C++ do we need to use dynamic pointers or stack memory is enough?

Please suggest any other use cases for dynamic pointers. I could not imagine the use cases.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,481 questions
{count} votes