我不确定如何解释 MSDN 中的 LayoutKind.Explicit:
The precise position of each member of an object in unmanaged memory is explicitly controlled. Each member must use the FieldOffsetAttribute to indicate the position of that field within the type.
成员是否与 CSharp 语言规范 §11.2 中定义的相同(因此方法可以存在并且 是编码的),还是像 §10.5 中那样表示字段,还是像 §5 中那样表示变量?
最佳答案
很明显,每个“成员”都必须标记FieldOffsetAttribute
,它只支持字段成员。
关于c# - 编码(marshal) c# 结构成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27572085/