How to quickly zero out an array?
Try Array.Clear():
Sets a range of elements in the Array to zero, to
false
, or tonull
(Nothing in Visual Basic), depending on the element type.
C++:
memset(array, 0, array_length_in_bytes);
C++11:
array.fill(0);
C#:
Array.Clear(array, startingIndex, length);
Java:
Arrays.fill(array, value);