© { JSL }
35
Array Notes
·
int
[ ] illegal[ , ];
class
Base {...}
class
Derived : Base {...}
Derived[] ds =
new
Derived[]{...};
Base[] bs = ds;
unsafe
{
int
* array =
stackalloc int
[42];
...
}
only one syntax
C# supports
array covariance
you can create
an array on the
stack, but only
in
unsafe
code
object
o =
new int
[42];
arrays are reference types
int
[ ][ , ] mixed;
you can mix the two
kinds of arrays