Software Development Network>> Visual C#>> Array of struct A in struct B!
Hi
struct A
{ int x; int y;}
struct B
{
int z;
A[] tab;
public B(int z, int tab)
this.z = z;
this.tab = new A[tab];
}
tab : 1) is it an array : A[] tab;
2) or an int : new A[tab];
Thanks
public B(int intZ, int tabLenght)
this.z = intZ;
this.tab = new A[tabLenght];
More clear now
Does B have to be a struct If so, can you add a parameterized constructor to it
1-yes B has to be a struct.
2-"can you add a parameterized constructor to it" : why not.
Array of struct A in struct B!
Scorpiuscat
struct B
{
int z;
A[] tab;
public B(int z, int tab)
{
this.z = z;
this.tab = new A[tab];
}
}
Loicus
tab : 1) is it an array : A[] tab;
2) or an int : new A[tab];
sunarc
Rush hour
struct B
{
int z;
A[] tab;
public B(int intZ, int tabLenght)
{
this.z = intZ;
this.tab = new A[tabLenght];
}
}
More clear now
Lance77035
Does B have to be a struct If so, can you add a parameterized constructor to it
Vinay Agarwal
1-yes B has to be a struct.
2-"can you add a parameterized constructor to it" : why not.