First of all, I looked through the questions, and I did not find the right thing, maybe it does not exist, but I will give it a shot. I am new to C #, and I'm starting from C ++, got a high school experience.
In C ++, I had it Vector<int> T[];, so I could create a list with a size that he did not know; and do something like that, and not waste space; more precisely
T[0][....];
T[1][...];
1 2 3 4 5
1 2 3
2 4 1 5
0 0 0 0 0 0
I am trying to do this in C # and it doesn't seem to work; I have tried this so far:
public class myints
{
public int x { get; set; }
}
public List<myints[]> T = new List<myints[]>();
T[i].Add(new myints() { x = i });
I want to be able to add material and then use Count()in forto find out how many elements I have in T[i]. how T[i].size()... is this possible?
program says System.Array does not contain a definition for Add
source
share