float init 0 request

Walter Bright newshound2 at digitalmars.com
Thu Aug 20 04:02:47 UTC 2026


On 8/15/2026 7:16 PM, monkyyy wrote:
> The intended initialization is 0 the vast majority of the time

Yes, you are correct.

> their data structures 0 initialize.

Use this for data structures:

```d
struct S {
     float f = 0;  // initializes struct to 0
}
float[100] a = 0; // initializes array to 0
```

Use calloc() to allocate memory for data structures.



More information about the Digitalmars-d mailing list