3 ms·
> RAII doesn't save you from buffer overflows How do other languages solve this problem? > or memory leaks when you need an object to live beyond the current
by eatitraw 13y ago
> RAII doesn't save you from buffer overflows
How do other languages solve this problem?
> or memory leaks when you need an object to live beyond the current scope.
Have you ever heard about smart pointers? They take most pain from dealing with pointers. Managing circular references remains a bit complex though.
- Skinney 13y ago> How do other languages solve this problem? Reading or writing past the allocated parts of a buffer is treated as a runtime error, wheras in C/C++ you just end up with corrupted memory. > Have you ever heard about smart pointers? Ahh, completely forgot about these. You're right, they're great.