C# why sizeof is unsafe and how to get size of a struct in a safe way?
<p>I've defined a struct to send via socket. I'd like to get the size of it but <code>sizeof</code> is unsafe and the same for "<code>System.Runtime.InteropServices.MarshalSizeOf</code>". Is there a way to get its size in a safe way?</p>
