How can I get the byte size of a type ? For exemple, the size of a Double
is 8, but how can I get this value programmatically ?
Thanks in advance :)
How can I get the byte size of a type ? For exemple, the size of a Double
is 8, but how can I get this value programmatically ?
Thanks in advance :)
You can use the Marshal.SizeOf-Method, which will return the size in bytes.
You can use it like that:
System.Runtime.InteropServices.Marshal.SizeOf(GetType(Double))
© 2022 - 2024 — McMap. All rights reserved.