Note: This website is archived. For up-to-date information about D projects and development, please visit

Learning D - Data Structures

Everything in D is centered around the idea of data. Your process data from the user or files and you produce your own data from that. This could be a game creating images based upon a player's movement, a web server getting input from a web browser and sending files over the internet, or it could even be a media player reading a song and playing it back to the user.

Understanding data structures will help you to know what you need to accomplish your goals and what data structures you can put together to do that.

Numeric Data Structures

bytesigned 8 bits
ubyteunsigned 8 bits
shortsigned 16 bits
ushortunsigned 16 bits
intsigned 32 bits
uintunsigned 32 bits
longsigned 64 bits
ulongunsigned 64 bits
centsigned 128 bits (reserved for future use)
ucentunsigned 128 bits (reserved for future use)
float32 bit floating point
double64 bit floating point
reallargest hardware implemented floating point size (Implementation Note: 80 bits for Intel CPUs)
ifloatimaginary float
idoubleimaginary double
irealimaginary real
cfloata complex number of two float values
cdoublecomplex double
crealcomplex real

Textual Data Structures

wcharwide character
dcharD character

Collection Data Structures

[ void ]Associative Array

Boolean Data

boolboolean value


Structs are Custom Data Structures


Classes are Custom Data Structures

Pointers and Void Type Data Structures

*the address of the data structure
voidno type needed, it could be any data structure


Functions are Unique

Next: Numeric Data in D?