Summary
In this chapter, you learned that there is no fixed limit to the number of dynamic variables or arrays that a program can create. The only limit is the amount of available memory. You learned that dynamic variables are created by an explicit statement, and destroyed by another explicit statement. There are two kinds of new
-expressions and two kinds of delete
-expressions—one each for ordinary variables and one each for arrays, respectively. You learned that mistakes made while creating, using, and deleting dynamic variables have consequences that vary depending on the operating system and compiler, but generally cause the program to crash. You learned that dynamic variables are referred to by pointers and that they can be linked together by pointers into lists, trees, and other data structures.
The next chapter discusses the ownership and lifetime of dynamic variables. Understanding these concepts allows the developer to more reliably manage dynamic variables, so that...