auto init & what the code means

bearophile bearophileHUGS at lycos.com
Sun Dec 26 06:31:07 PST 2010


Andrej Mitrovic:

> int i;    // auto-initialized to int.init
> int i = void; // not initialized

I think the OP meant:

1) int i = void; // not initialized
2) int i = 0; // initialized to 0
3) int i; // meant to be auto-initialized to int.init, similar to case 2
4) int i; // auto-initialized to int.init, but logically not initialized yet in the algorithm

So he was thinking about ways to tell apart case 3 from case 4 (C# doesn't have this problem).

Bye,
bearophile


More information about the Digitalmars-d mailing list