Summing Up

You have just gone through one of the most difficult lessons in this book. Pointers are critical to mastering C++, but they are the cause of a large number of programming problems. You have seen how stack allocation and heap allocation differ from each other, how to get storage from the heap, how to use it, and how to get rid of it. You have seen some of the common mistakes and dangers, and have, hopefully, developed a serious respect for the power and the potential for problems that pointers represent.

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.