gpt4 book ai didi

c# - 编码(marshal) c# 结构成员

转载 作者:太空宇宙 更新时间:2023-11-03 13:13:13 24 4
gpt4 key购买 nike

我不确定如何解释 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com