This is a modified example from TDPL, page 185-186, although I've increased the
size of the array here:
class Transmogrifier
{
double[512] alpha = void;
size_t usedAlpha;
this()
{
}
}
void main()
{
auto t = new Transmogrifier;
writeln(t.alpha);
}
This will write 512 zeros in my case. If I understood correctly, then alpha is
an array containing 512 uninitialized values. Which is confusing me as to why
I'm getting back zeros.
If this was C (minus the classes), I'd get back random values at random
locations in memory until I stepped into the wrong place, which would hopefully
terminate my app.
I guess I need a primer in how D manages memory, is what I'm really saying. :)