john ranella

john ranella

  • 1.5k
  • 193
  • 5.8k

copy struct

Oct 31 2014 4:59 AM
Hi,
I'm trying to convert this code written in c to c#, in particular I'm looking for copy a struct from memory area to another memory area 

Example in C
memcpy(&LastRestore, &struct, sizeof(struct));


How can i implement this in C#?

this is an example of struct:

public struct a
{

public a(uint i): this()
{


z = new bool[14];

}
public double a;
public float c;
public ushort f;
public short h;
public bool l;
public bool[] z;
}

Answers (1)