© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
M. KalinModern C Up and Runninghttps://doi.org/10.1007/978-1-4842-8676-0_3

3. Aggregates and Pointers

Martin Kalin1  
(1)
Chicago, IL, USA
 

3.1 Overview

This chapter focuses on arrays and structures, which are C’s primary aggregate types. Arrays aggregate variables of the same type, whereas structures can do the same for variables of different types. Structures can be array elements, and a structure may embed arrays. Together these aggregate types make it possible for programmers to define arbitrarily rich data types (e.g., Employee, Game, Species) that meet application needs.

Pointers—address constants and variables—come into play naturally with both arrays and ...

Get Modern C Up and Running: A Programmer's Guide to Finding Fluency and Bypassing the Quirks 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.