Arrays of Arrays

wildfire1982

Regular
Joined
Oct 23, 2003
Messages
50
Location
Southampton
I will have a fairly resource hungry program which is to be storing data similar to how a database might store data but in a way that can be accessed quickly. So i really need an array of arrays to save space. I have thought of using a 3 dimesional array instead but it would create a bit too much data and an array of arrays should store considerably less. Another reason for using an array of arrays is that i dont know how much data is going to be put into the program each time. So... how do you declare and use one of these. The structure will be something like this although i havent finished thinking it through.

overallArray( IngredientsArray(PropertiesArray(1,Infinity)))

See what i mean? so there will be one overallArray which stores an infinite number of Ingredients which can also have an infinite number of properties.

Cheers folks
 
If you need to dynamically change the size of your array then look into the ArrayList class. Simply using the Add method of the ArrayList will let you add another one. I don't know if Im getting your whole problem right so correct me if im wrong.
 
Back
Top