Fractal wrote: > Hello > > if I have the following code: > > int foo; > foo = 5; > > When the variable foo is declared, it is initialized to int.init, or has > garbage contents until it is assigned? > > Thanks
D will always initialize variables unless you explicitly tell it not to. (although a smart compiler may optimize certain cases) Here's how to get foo initialized to garbage: int foo = void; foo = 5;
