This tutorial covers dynamic memory allocation in C++ for both single objects and arrays of objects. A common beginner bug, dangling pointers, is also described.
This article discusses C++ in the context of several other popular languages. It also describes the kinds of memory errors that can occur in C++ programs.
Presents a list of simple, powerful techniques that can be used to deal with memory in C++ programs.
Introduces smart pointers and takes a look at Boosts various smart pointer templates (scoped_ptr, scoped_array, shared_ptr, and shared_array).
Andrei Alexandrescu navigates through the sometimes treacherous waters of using smart pointers, which imitate built-in pointers in syntax and semantics but perform a host of additional tasks that built-in pointers can't.
Andrei Alexandrescu discusses smart pointers, from their simplest aspects to their most complex ones and from the most obvious errors in implementing them to the subtlest ones--some of which also happen to be the most gruesome.
Memory management is scary. It should be: A lot can go wrong--often very wrong. But a moderately experienced C or C++ programmer can learn and understand memory hazards completely.
Stephen Dewhurst discusses how the various features of C++ are used together in memory management, how they sometimes interact in surprising ways, and how to simplify their interactions.
This article explains design principles that will help keeping memory management error out of C++ code.
Matthew and Bjorn update the well-known Rule of The Big Three, explaining which one of those member functions is not always needed.
Computers /
Programming /
Memory_Management
|