January 05, 2014 Re: Prevent Garbage Collector | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeroen Bollen | On 2014-01-05 01:17, Jeroen Bollen wrote: > Also a somewhat unrelated question, variables in D get initialized by > default, do they also when you define them right after? Something like: > > int[] iryy = new int[](50); // Will the array elements be initialized to 0? Yes, have a look at: http://dlang.org/arrays.html#array-initialization This example verifies the behavior: int[] iryy = new int[](50); assert(iryy[3] == 0); -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation