D
Dennis Myrén
Hi.
I have an array of struct.
My question is, if i do:
STRUCT [] a = new STRUCT [0xA];
STRUCT s = new STRUCT();
a [0x0] = s;
since STRUCT is a value type, when assigning element 0 of the STRUCT array
as above,
is the STRUCT then copied to the array, as is the usual case of value types?
I guess it is.
This structure is kind of heavy.
It is as well a managed struct, therefore i cannot use pointers.
My option might be to, rather than assigning the elements,
to use the array directly with indexing(a lot of indexing then):
STRUCT [] a = new STRUCT [0xA];
a [0x0].PROPERTY = 0x0;
Please give me some thoughts about this.
Thank you!
I have an array of struct.
My question is, if i do:
STRUCT [] a = new STRUCT [0xA];
STRUCT s = new STRUCT();
a [0x0] = s;
since STRUCT is a value type, when assigning element 0 of the STRUCT array
as above,
is the STRUCT then copied to the array, as is the usual case of value types?
I guess it is.
This structure is kind of heavy.
It is as well a managed struct, therefore i cannot use pointers.
My option might be to, rather than assigning the elements,
to use the array directly with indexing(a lot of indexing then):
STRUCT [] a = new STRUCT [0xA];
a [0x0].PROPERTY = 0x0;
Please give me some thoughts about this.
Thank you!