float init 0 request
Walter Bright
newshound2 at digitalmars.com
Wed Aug 19 07:31:14 UTC 2026
On 8/17/2026 7:03 AM, Quirin Schroll wrote:
> Maybe the next D Edition could require initialization of types that don’t
> initialize with a value equal to `0`. D’s behavior with these is annoying,
> because leads to needless debug sessions, and also surprising because no other
> language that D is similar to does that: C++. C# and Java all default-initialize
> to `0`.
My reply to this seems to have disappeared.
C and C++ default initialize locals to garbage, not zero.
C# and Java give a runtime error if you use locals without explicit initializations.
More information about the Digitalmars-d
mailing list