In C#.NET I can to use List<myclasstype> vals = new List<myclasstype> ();
it's possible do equivalent to in C?
I have an struct like:
typedef struct foo {
int x;
int y;
} Baa;
and I want do:
**BAA vals = ??
int i ;
for(i = 0; i < size; i++)
{
vals[i].x = i;
vals[i].y = i * 10;
}
I hope this is clear for you. Thanks in advance.
It is the same as you would create any other array in C except that the type is replaced with
Baa
You can also use pointers and malloc to accomplish this:
Hope this helps.