"kiplring" <(E-Mail Removed)> wrote:
> 1.
> int[] intArr = new int[255];
All dynamic allocation with 'new' is initialized to whatever '0' means
for that type. For this array, that means the whole array will be zeroed
out.
> 2.
> int[] intArr = new int[255];
> rgnNumberArr.Initialize();
I don't know what rgnNumberArr has to do with intArr, so I can't comment
on this code.
Array.Initialize() is for value types that have constructors (i.e. from
C++); you typically don't need to call it in a C# application. Also, the
C++ folks have been toning down their guarantees on .NET about default
construction of value types, so now it's even less necessary.
> 3.
> int[] intArr = new int[255];
> for( int i=0; i<intArr .lenght; i++)
> {
> intArr [i] = 0;
> }
This loop is redundant.
-- Barry
--
http://barrkel.blogspot.com/