I have this code which doesn’t compile:
public struct MyStruct
{
private fixed uint myUints[32];
public uint[] MyUints
{
get
{
return this.myUints;
}
set
{
this.myUints = value;
}
}
}
Now, I know why the code won’t compile, but I’m apparently at the point where I’m too tired to think, and need some help to put me in the right direction. I haven’t worked with unsafe code in a while, but I’m pretty sure I need to do an Array.Copy (or Buffer.BlockCopy?) and return a copy of the array, however those don’t take the arguments I need. What am I forgetting about?
Thanks.
You have to work in a
fixedcontext when working with afixedbuffer: