float init 0 request
Walter Bright
newshound2 at digitalmars.com
Tue Aug 18 03:15:17 UTC 2026
On 8/17/2026 7:16 AM, libxmoc wrote:
>> and also surprising because no other
>> language that D is similar to does that: C++. C# and Java all
>> default-initialize to `0`.
C and C++ still do not default initialize stack variables to anything other than
garbage.
C# and Java do not default initializer locals, either. If you try to read it
before explicitly assigning a value, you get an error.
(It's extremely difficult to track down an uninitialized variable in C and C++,
because every change you make to the program to try and track it down, changes
the values in it.)
More information about the Digitalmars-d
mailing list