System.Collecti ons.Generic.Lis t<intmyList = new
System.Collecti ons.Generic.Lis t<int>(100);
Does this preallocate 100 integers?
Also, is there any way to preallocate an array of objects all at once?
MyOb[] al= new MyOb[100];
for (int z = 0; z < nCount; z++)
{
al[z] = new MyOb();
}
Can i avoid all these new and just allocate an array of MyOb all at once?
System.Collecti ons.Generic.Lis t<int>(100);
Does this preallocate 100 integers?
Also, is there any way to preallocate an array of objects all at once?
MyOb[] al= new MyOb[100];
for (int z = 0; z < nCount; z++)
{
al[z] = new MyOb();
}
Can i avoid all these new and just allocate an array of MyOb all at once?