Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Today is a sad day because I am a little bit disappointed about VB.NET . I always thought that boolean variables are bits but now I discovered that they are 2 bytes (16 bits) !!!!

 

What do u need more than a 1 and a 0 for a boolean.

 

Please enlighten me..

Dream as if you'll live forever, live as if you'll die today
Posted
Today is a sad day because I am a little bit disappointed about VB.NET . I always thought that boolean variables are bits but now I discovered that they are 2 bytes (16 bits) !!!!

 

What do u need more than a 1 and a 0 for a boolean.

 

Please enlighten me..

 

Faster chips and processors are the source of it. We're emerging with technology to 64-bit processors. FYI, You can still declare a short integer in VB.Net.

Take care,

Lori :D

--DreamWEBCatcher.com

  • *Experts*
Posted

If you want to store many boolean values (1 and 0) in one variable, you can look at storing flags as bits inside an Integer. In one Integer you can store 32 on/off values by using bitwise operators to set each of the 32 bits individually.

 

There's not really much of an advantage over using an array of Booleans though, other than its easier to store.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...