C++: how to use smart pointers?
Example:
int* ptr = new int(5);
Smart pointers automatically manage memory.
Solution:
std::unique_ptr ptr(new int(5));
Example: Solution:C++: how to use smart pointers?
Smart pointers automatically manage memory.
int* ptr = new int(5);
std::unique_ptr