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))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With