#memory
- 10 Jan 2024 · Study
C++ · Smart pointers
unique_ptr for single ownership, shared_ptr with reference counting, weak_ptr to break cycles, and make_unique/make_shared.
- 5 Jan 2024 · Study
C++ · Memory: new, delete and RAII
Stack vs heap, manual new/delete and why it leaks, and RAII: tying a resource's lifetime to an object's scope.
- 14 Nov 2023 · Study
C++ · Pointers
What a pointer is, & and * operators, nullptr, pointer arithmetic over an array, and why dangling pointers are dangerous.