8ARRAY DATA TYPES

image

High-level language abstractions hide how the machine deals with composite data types (a complex data type composed of smaller data objects). Although these abstractions are often convenient, if you don’t understand the details behind them you might inadvertently use a construct that generates unnecessary code or runs slower than need be. In this chapter, we’ll take a look at one of the most important composite data types: the array. We’ll consider the following topics:

  • The definition of an array

  • How to declare arrays in various languages

  • How arrays are represented in memory

  • Accessing elements of arrays

  • Declaring, representing, ...

Get Write Great Code, Volume 2, 2nd Edition 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.