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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top