On Tuesday, 5 June 2018 at 14:52:28 UTC, Timoses wrote:
Does `int[4] nums = void` work?
Work for what?
If you avoid initialization, then the variable(s) are not
initialized.
https://dlang.org/spec/declaration.html#void_init
However, an int is not nullable and always contains a value.
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 a
On 06/02/2018 08:35 PM, Neia Neutuladh wrote:
2. `int[4] a = null` treats the initialization as a copy from an array
whose value is null. If you run just that line of code, it will produce
an error at runtime: "object.Error@(0): Array lengths don't match for
copy: 0 != 4"
If you want to initi
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 a
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?