4SOLVING PROBLEMS WITH POINTERS AND DYNAMIC MEMORY

image

In this chapter, we’ll learn to solve problems using pointers and dynamic memory, which will allow us to write flexible programs that can accommodate data sizes that are unknown until the program runs. Pointers and dynamic memory allocation are “hard-core” programming. When you can write programs that grab blocks of memory on the fly, link them into useful structures, and clean up everything at the end so there is no residue, you’re not just someone who can do a little coding—you’re a programmer.

Because pointers are tricky, and because many popular languages, such as Java, appear to forgo the ...

Get Think Like a Programmer 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.