11-21-2016, 05:22 PM
Yes.
C:
union X { int a; double b; byte c; };
QM:
type X int'a []double'b []byte'c
C#:
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Explicit)]
struct X { [FieldOffset(0)] public int a; [FieldOffset(0)] public double b; [FieldOffset(0)] public byte c; };
C:
union X { int a; double b; byte c; };
QM:
type X int'a []double'b []byte'c
C#:
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Explicit)]
struct X { [FieldOffset(0)] public int a; [FieldOffset(0)] public double b; [FieldOffset(0)] public byte c; };