I am trying to understand explicit struct layout and struct overlaying and i am not seeing behaviour i expect.Given the code below:
I\'ve the following class [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public class xy11Data开发者_开发百科set : SZLDataset
Why does LayoutKind.Sequential work differently if a struct contains a DateTime field? Consider the following code (a console app which must be compiled with \"unsafe\" enabled):
By default structs in C# are implemented with [StructLayout( LayoutKind.Sequential )] for reasons basically stating that these type of objects are commonly used for COM Interop and their fields must s