A Conversation for Variables in C++

Correction

Post 1

Mork29

Bools, and i belive some other data types, differ between systems, and compilers. Bools namely differ in the value they hold. Some hold, TRUE/FALSE, while others hold true/false, others don't care about capitilization, and there are very some evironments when 1/0 is used for true/false.


Correction

Post 2

Ancient

That's strange because I thought bools nearly always where -1 is true and 0 is false. The obviously throws a spanner in the idea that truth is the greater.... Of course this could just be a load of bool! Sorry couldn't resist


Correction

Post 3

The Artist Formerly Known as Nerd42

Bool! You can make bool variables in any language you want. It's easy!

Here it is in BASIC:

1 RANDOMIZE TIMER
10 CONST TRUE = 1
20 CONST FALSE = 0


In QBASIC:

RANDOMIZE TIMER
CONST TRUE = 1
CONST FALSE = NOT TRUE


(qbasic is different and better than basic, but it had to be said)

You can also get libraries for it in QuickBasic 4.5, Inform, and many others. So the point I'm trying to make by using the stupidest languages ever is that you never ever have to go without bool variables at all. (uh, I mean IDENTIFIERS) Post the correct syntax in all the languages you know here. I'd like to see them.

smiley - towelNerd42


Correction

Post 4

Ancient

Yes, but this is C++ - and whilst it is true that basic (Visual) or othewise contains a lot of bool - it just isn' C++. In C++ bool is often an int and set to -1 or 0.


Correction

Post 5

The Artist Formerly Known as Nerd42

smiley - pirateArr! That's stupid! Why can't they just settle for a simple 1 and 0??? smiley - grr
Oh well. smiley - winkeye
smiley - towelNerd42


Key: Complain about this post

More Conversations for Variables in C++

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more