Profile photo
Submitted by Sunil Sharma
on December 14th, 2011 at 10:30:50 EST

Create dynamic array in C#

I am looking for way to create dynamic array that I can easily insert/add new elements. How do I create dynamic array in C# .NET?

Profile photo
Replied by RaKumar
on December 15th, 2011 at 08:49:58 EST
Use generic List<> or ArrayList.
I prefer using List<> since its generic class and type safe. you can add, insert using List<>.
Accepted Answer

Profile photo
Replied by Sunil Sharma
on December 15th, 2011 at 15:20:19 EST
Generic List<> solved what I am looking for. Thanks.

Profile photo
on April 11th, 2012 at 01:47:18 EST