16 lines
474 B
D
16 lines
474 B
D
|
import std.stdio;
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
auto arr1 = new int[4];
|
||
|
assert(arr1.length == 4);
|
||
|
assert(arr1 == [ 0, 0, 0, 0 ]); // Инициализирован по умолчанию
|
||
|
|
||
|
auto arr2 = new int[](4);
|
||
|
assert(arr2.length == 4);
|
||
|
assert(arr2 == [ 0, 0, 0, 0 ]); // Инициализирован по умолчанию
|
||
|
|
||
|
auto matrix = new int[][](4, 8);
|
||
|
assert(matrix.length == 4);
|
||
|
assert(matrix[0].length == 8);
|
||
|
}
|