arrays,

  • Thread starter Thread starter cronusf
  • Start date Start date
C

cronusf

If I allocate a byte array:

byte[,,] = new byte[rows, cols, slices];

are the elements zeroed out, or do I need to manually call Initialize
()?
 
In a multi-dimensional array (byte[,,]), then yes - they are all zero
automatically.

For a jagged array (byte[][][]), then "zero" means "null" - and you
need to manually create the inner arrays.

Marc Gravell
[C# MVP]
 
Back
Top