![]() |
Click here to advertise with us
|
|
|||||||
| .NET Framework In depth discussion of the .NET Framework |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all,
In .Net framework, Boolean data type took 2 bytes of space in memory. But, in other languages like c, c++ ... it took only 1 byte. Can any one tell me why it took 2 bytes instead of 1 byte and tell me what is the default values for true case and false case? Thxs in advance, Purushottam. |
|
||||
|
When numeric data types are converted to Boolean values, 0 becomes False and all other values become True. When Boolean values are converted to numeric types, False becomes 0 and True becomes -1.
As for why it takes 2 bytes.. why does other languages use a whole byte when really only a bit is necessary to tell 0/1 true/false on/off etc ? It is probably some inherent thing.
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|