dlang-book/02-основные-типы-данных-выр.../src/chapter-2-3-6-1/app.d

16 lines
474 B
D
Raw Normal View History

2023-01-22 21:14:13 +00:00
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);
}