Summary
In this chapter, we used the concepts introduced in two earlier chapters, Chapter 11, Working with Arrays, and Chapter 13, Using Pointers, to learn how array names and pointers are related and interchangeable.
We have seen various memory layouts of arrays and pointers and used pointers in various ways to access and traverse arrays, both directly and via function parameters. We also have seen how pointer arithmetic pertains to elements of the array and is a bit different from integer arithmetic. We learned about some of the similarities and differences between a 2D array (a contiguous block of elements) and an array of pointers to sub-arrays (a collection of scattered arrays indexed by a single array of pointers). Finally, we looked at a set of simple programs that illustrate as well as prove the concepts we have learned.
Having explored arrays and pointers and their interrelationship, we are now ready to put all of these concepts to good...