Completing C code with D style

foxit foxit at gmail.com
Fri Nov 12 00:55:27 UTC 2021


On Thursday, 11 November 2021 at 23:41:48 UTC, kdevel wrote:
> On Thursday, 11 November 2021 at 22:30:12 UTC, forkit wrote:
> [...]
>>      for(int i = 0; i < sizeof(numbers) / sizeof(int); ++i) // 
>> is so much safer - in C style
>
> I made it even safer:
>
>    for (int i = 0; i < sizeof numbers / sizeof *numbers; ++i)
>

(void*)*numbers = NULL;

..don't you just love C ;-)



More information about the Digitalmars-d-learn mailing list