I was going to use a standard array, I need it to x number of rows and be 2 columns
double[,] members = new double[x, 2];
and loop through all the results I get back and then add them to the array, but as the number of results can change I don’t want to pre-define the size of the array…
members[0, 0] = cost;
members[x, 1] = tax;
x++;
I was looking at resizing the array but would it be easier just using an arraylist or list of lists for this?
Perhaps the number of items in the second dimension is fixed, or at least, is predictable, so if you’re using Microsoft .NET Framework 4.0, you can use a list of tuples:
You can always implement some kind of value object class which has Cost and Tax properties, but using tuples you can do it as easy as I shown you in my code sample.