K
keeling
I am surprised that no one pointed out that .NET has a way of treating
Boolean values as bits. Its called... a BitArray (http://
msdn.microsoft.com/en-us/library/system.collections.bitarray.aspx). If
you are concerned with the memory you are using to store Boolean
values (e.g. you have a large collection of them) this may be a
solution for you.
As for why a bool is 4 bytes; my understanding was that it is more
efficient.![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)
Boolean values as bits. Its called... a BitArray (http://
msdn.microsoft.com/en-us/library/system.collections.bitarray.aspx). If
you are concerned with the memory you are using to store Boolean
values (e.g. you have a large collection of them) this may be a
solution for you.
As for why a bool is 4 bytes; my understanding was that it is more
efficient.
![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)