Solved

Add to open ended array

Posted on 2003-10-23
4
383 Views
Last Modified: 2006-11-17
ok so if I create an array like this

obj[] array = new obj[];


how would I add values to this dynamically
0
Comment
Question by:jayrod
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:msdixon
ID: 9609295
you can use an ArrayList
0
 
LVL 20

Accepted Solution

by:
TheAvenger earned 125 total points
ID: 9612448
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
0
 
LVL 9

Expert Comment

by:msdixon
ID: 9613971
hey, i gave that answer...
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 9613994
Actually I agree that msdixon deserved at least some of the points...
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Offline Apllication 5 70
SQL Exceptions 3 43
WCF Service Application cannot connect from TCP terminal 1 31
Can I command line build a C# application? 6 30
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question