Automatic void initialization

BCS none at anon.com
Sun May 31 17:44:23 PDT 2009


Hello Fractal,

> 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
> 

int.init unless the compiler rewrites it as

int foo = 5;

and then 5.





More information about the Digitalmars-d mailing list