Understanding Arrays and Pointers

C pointers and arrays are closely related; so closely, in fact, that they are often interchangeable! However, this does not mean pointers and arrays are identical. We will explore this relationship and why we might want to use either array notation or pointer notation to access array elements.

Having read two previous chapters, Chapter 11, Working with Arrays, and Chapter 13, Using Pointers, is essential to understanding the concepts presented here. Please do not skip those chapters before reading this one.

The following topics will be covered in this chapter:

  • Reviewing the memory layout of arrays
  • Understanding the relationship between array names and pointers
  • Using pointers in various ways to access and ...

Get Learn C Programming 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.