Chapter 9. Working with Pointers

Every interesting C program that solves a real-world problem uses pointers and dynamic memory. Together, these two tools enable you to create programs that use more complex data structures than the ones you have seen so far (simple scalar values and arrays of scalar values).

This chapter introduces pointers, a prerequisite for working with dynamic memory, the topic covered in the following chapter. The two concepts—and therefore the two chapters—are closely related. Working with pointers also brings you in closer contact with the machine's low-level workings. For example, you will see and work with addresses of the objects in your computer's memory. This is less abstract than working with variables, and you will gain a valuable understanding of the way C programs run.

Pointers can be confusing for beginning readers, so take your time and follow the examples closely. This is definitely one of those chapters you may want to revisit later. Teaching these concepts requires the use of several rather trivial examples at first, but only by going through these exercises can you follow the more advanced, practical applications to follow in the remaining chapters.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset