why in boolean we use 16 bits not 8 bit????????
Printable View
why in boolean we use 16 bits not 8 bit????????
Yes why isn't it just one bit?
The simple answer is because Microsoft designed it that way.
Before VB4 there was no Boolean data type but the values True and False existed.
True is in VB -1 and False is 0.
Since a VB Integer is still 16 bit and not 32 a value of -1 in binary would be 1111111111111111 and 0 would be 0000000000000000.
When Microsoft introduced the Boolean data type in VB4 they could not change the values of True and False without breaking the backward compatability with older programs.
That's why a Boolean must be of the same length as an Integer.
Shouldn't the question then be
instead ofQuote:
why in boolean we use 16 bits not 1 bit????????
Quote:
why in boolean we use 16 bits not 8 bit????????