Solved

Add to open ended array

Posted on 2003-10-23
4
376 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
Comment Utility
you can use an ArrayList
0
 
LVL 20

Accepted Solution

by:
TheAvenger earned 125 total points
Comment Utility
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
Comment Utility
hey, i gave that answer...
0
 
LVL 20

Expert Comment

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now