bool

This is a discussion on bool within the C++ Programming forums, part of the General Programming Boards category; what does bool means? is it a kind of variable declaration?...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220

    bool

    what does bool means? is it a kind of variable declaration?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    A bool is a type, just like int, char and double. It holds boolean values. There are only two possible boolean values: true or false. So every bool variable holds either true or false.

    They are used a lot in programming because many situations rely on some state or expression being true or false (like the controls of if statements or loops).

  3. #3
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,077
    More than a data type, Boolean logic is one of the backbones of computer science. Computers at their very core work with Boolean logic. True and False, On and Off, 1s and 0s... This and that, this or that, this not that.

    You should do a search on Google about "Boolean Logic" or "George Boole". It's one of the fundamentals of Computer Science and understanding it will greatly help you advance as a programmer.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. passing params between managed c++ and unmanaged c++
    By cechen in forum C++ Programming
    Replies: 11
    Last Post: 02-03-2009, 08:46 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 08:05 AM
  3. DirectInput help
    By Muphin in forum Game Programming
    Replies: 2
    Last Post: 09-10-2005, 12:52 PM
  4. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 05:25 AM
  5. Need Help With an RPG Style Game
    By JayDog in forum Game Programming
    Replies: 6
    Last Post: 03-30-2003, 08:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21