Answer by Hans Passant for What is the size of a boolean In C#? Does it...
The bool type has a checkered history with many incompatible choices between language runtimes. This started with an historical design-choice made by Dennis Ritchie, the guy that invented the C...
View ArticleAnswer by Jon Skeet for What is the size of a boolean In C#? Does it really...
Firstly, this is only the size for interop. It doesn't represent the size in managed code of the array. That's 1 byte per bool - at least on my machine. You can test it for yourself with this code:...
View ArticleWhat is the size of a boolean In C#? Does it really take 4-bytes?
I have two structs with arrays of bytes and booleans: using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential, Pack = 4)] struct struct1 { [MarshalAs(UnmanagedType.ByValArray,...
View Article
More Pages to Explore .....