Chapter 7
Structs and Unions
Collections of related variables can be grouped together into composite data objects called
structs and unions. You can define these objects in D by creating new
type definitions for them. You can use your new types for any D
variables, including associative array values. This chapter explores the syntax and semantics for
creating and manipulating these composite types and the D operators that interact with
them. The syntax for structs and unions is illustrated using several example programs
that demonstrate the use of the DTrace fbt and pid providers.