简体   繁体   中英

What is the size of ValueType when declared as part of a class?

In case of this class

public class Foo {public Int32 MyField; }

What will be the size of MyField? Is it only 4bytes on x86 machine, or it has usual overhead for objects?

MyField将是4个字节,开销是父Foo对象的开销。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM