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

5. Arrays

Thomas Mailund1  
(1)
Aarhus N, Denmark
 

Arrays are collections of objects of the same type, laid out in memory as a sequence of contiguous objects. There is a close relationship between arrays and pointers to the first element in an array; you can use an array as if it is a pointer to its first element, and it degrades to that type automatically if you use it that way. If you pass arrays as arguments to functions, they are always implicitly passed by reference, as a pointer to the first element. They are still different types, however. You cannot assign to an array, so in that way arrays resemble const pointers , and the size of an array ...

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.