2.6 Array Overview

D permits you to define variables that are integers, as well as other types to represent strings and composite types called structs and unions. If you are familiar with C programming, you will be happy to know you can use any type in D that you can in C. If you are not a C expert, do not worry: the different kinds of data types are all described in Section 2.8, “Types, Operators, and Expressions”.

D also supports arrays. Linearly indexed scalar arrays, familiar to C programmers, are discussed in Section 2.10.3, “Array Declarations and Storage”.

More powerful and commonly used are associative arrays, which are indexed with tuples. Each associative array has a particular type signature. That is, its tuples all have the same number of elements, those elements of consistent type and in the same order, and its values are all of the same type. D associative arrays are described further in Section 2.9.2, “Associative Arrays”.