Smart Pointers vs Raw Pointers in Modern C++



  • Hi everyone,

    I'm fairly new to C++ coming from a Python background and I'm struggling to understand when to use smart pointers versus raw pointers. I understand the general principle that smart pointers handle memory automatically, but I'm not sure when it's actually appropriate to use a raw pointer in modern C++ and whether there are cases where smart pointers would be overkill or cause issues.

    Any practical guidance on how to think about this decision would be really appreciated!


Anmelden zum Antworten