CHAPTER 3
Pointer Arithmetic and Single Dimension Arrays
Arithmetic operations can be performed on most, but not all variables. Fortunately, these operations can also be performed on pointer variables. This is one of the most important uses of pointers, in addition to referencing and dereferencing the memory addresses.
This navigation is achieved with the help of some limited arithmetic operations provided by C language.
When visualizing memory as laid out in consecutive blocks, the natural thought process points us to the array data type because an array’s indices are laid out consecutively, too. The usage of pointer arithmetic comes along with ...
Get Pointers in C: A Hands on Approach 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.