© Thomas Mailund 2021
T. MailundPointers in C Programminghttps://doi.org/10.1007/978-1-4842-6927-5_6

6. Working with Arrays

Thomas Mailund1  
(1)
Aarhus N, Denmark
 
Enough about general considerations for arrays and pointers—it is time we see how we use both in practice. I will start by showing a few examples of how we can solve some selected problems using both arrays and pointers and illustrate how closely related the two things are. Quite often, the code you write to operate on an array is the same as the code you write to operate on pointers, even when you do not use pointers plus offsets (which is, after all, exactly what we do when we use the array syntax). In an attempt to make it at least appear that we are working with two different types ...

Get Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays 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.