Basic types

Most of D's basic data types will be familiar to C-family programmers. In this section, we're first going to look at what the basic data types are. Then we'll discuss a couple of features that are related not only to the basic types, but to all types.

The types

First up, D includes the special type void to mean no type. There is no such thing as a variable of type void. As in C, void is used to indicate that a function does not return a value. void pointers can be declared to represent pointers to any type.

Instances of the bool type are guaranteed to be eight bits in size and can hold one of two possible values: true and false. In any expression that expects a Boolean value, any zero value is converted to false and non-zero is converted ...

Get Learning D 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.