[3.0/LINQ] add to an existing array
I know this is probably prety noob of me but im having a brain fart
In useing .net 3.0 i want to add to an array in a loop but as it is now i just over write the array each time the loop goes through.
ive been pokeing around and i dont see .add some im wondering what i should be looking for
thanks
Re: [3.0/LINQ] add to an existing array
Arrays are fixed size. If you want to make an array grow you have to create a new array with the desired size and copy all the elements from the existing array to the new one. The Array.Resize method will do that for you but that's not something you should be doing too often. It's quite time consuming, especially with larger arrays. If you want a "dynamic array" then you should be using a List<T>, which exists specifically for the purpose.
Re: [3.0/LINQ] add to an existing array
10-4
thanks I'll give it a try