Suppose I have this code:
struct Normal
{
public float x;
public float y;
}
class NormalContainer
{
public Normal[] Normals
{
get; set;
}
}
class Main
{
void Run( NormalContainer container )
{
Normal[] normals = container.Normals // 1 - see below
normals[5].x = 4; // 3 - see below
container.Normals = normals; // 2 - see below
}
}
Does (1) create a copy of the array or is this a reference to the memory occupied by the array? What about (2) ?
Thanks