Глава 2 закончена
This commit is contained in:
parent
42b2af19c0
commit
09dc3df444
18 changed files with 261 additions and 1 deletions
16
02-основные-типы-данных-выражения/src/chapter-2-3-6-1/app.d
Normal file
16
02-основные-типы-данных-выражения/src/chapter-2-3-6-1/app.d
Normal file
|
@ -0,0 +1,16 @@
|
|||
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue