C#实现联合体
2021-07-01 16:08
标签:str field 实现 out set bsp oat color type C#实现联合体 标签:str field 实现 out set bsp oat color type 原文地址:https://www.cnblogs.com/timeObjserver/p/9942987.html [StructLayout(LayoutKind.Explicit, Size = 8)]
public struct TypeTransform
{
[FieldOffset(0)]
public float f;
[FieldOffset(0)]
public int i;
[FieldOffset(0)]
public double d;
[FieldOffset(0)]
public long l;
//[FieldOffset(0)]
//public byte b1;
//[FieldOffset(1)]
//public byte b2;
//[FieldOffset(2)]
//public byte b3;
//[FieldOffset(3)]
//public byte b4;
}