Add to open ended array

jayrod
jayrod used Ask the Experts™
on
ok so if I create an array like this

obj[] array = new obj[];


how would I add values to this dynamically
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
you can use an ArrayList
obj[] array = new obj[];

is illegal code in C# - you have to specify a size. For dynamic arrays use ArrayList or any other collection from System.Collections, as msdixon already told you

Commented:
hey, i gave that answer...
Actually I agree that msdixon deserved at least some of the points...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial