B is now an array of five ints.
This statement creates an array a that can contain integers.
The main difference is, that this array is not a static compiled in array and so can change it's length:
int[] nonstatic;
int[3] static1;
int[5] static2;
nonstatic = static1;
static1 = static2;
|
In D, every array is a reference to a data structure. After the above code, a change in nonstatic will change static, too!
There is also the possibility to create a pointer to an int structure. This pointer is no array, but it is the real reference 'as variable', can do more than an array but can't use the functions of an array so easily:
int* p;
int[5] a;
int[] b;
p = a; p = null;
b = a;
b[0..2] = 5;
|
More array features:
1.
Properties
2.
Concatenation
3.
Slicing
4.
Copying
5.
Operations
|