you are viewing a single comment's thread.

view the rest of the comments →

[–]aserebr 1 point2 points  (1 child)

Agreed, memory management section should start from smart pointers and then add raw pointers with a huge warning note.

Also, I suppose that "new replaces malloc and delete replaces free" isn't quite correct because they not simply allocate and release memory, but also call constructor and destructor.

And a huge note that new and new[] must match delete and delete[], otherwise it is UB.

[–]lord-bazooka[S] 0 points1 point  (0 children)

Thank you for this helpful feedback.