determining if array element is null

Timoses timosesu at gmail.com
Tue Jun 5 14:52:28 UTC 2018


On Saturday, 2 June 2018 at 18:10:38 UTC, eastanon wrote:
> Does D array implementation support an array of null values?
>
> int a[4] = null;
>
> But I ran into a type error while checking if a[i] is null
>
> foreach(i; 0..3){
>  if(i == null){
>    writeln("it is null");
>    }
>   }
> }
>
> How do you set fixed size array of null values and check if 
> they are null?

Does `int[4] nums = void` work?


More information about the Digitalmars-d-learn mailing list