C#里面有没有类似memset功能的函数
1个回答
展开全部
用显示分配
[StructLayout(LayoutKind.Explicit)]
public struct Answer
{
[FieldOffset(0)]public Int16 name;
[FieldOffset(2)]public Int16 type;
[FieldOffset(4)]public Int16 class1;
[FieldOffset(6)]public UInt32 ttl;
[FieldOffset(10)]public UInt16 length;
}
[StructLayout(LayoutKind.Explicit)]
public struct Answer
{
[FieldOffset(0)]public Int16 name;
[FieldOffset(2)]public Int16 type;
[FieldOffset(4)]public Int16 class1;
[FieldOffset(6)]public UInt32 ttl;
[FieldOffset(10)]public UInt16 length;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询