A Conversation for Variables in C++
Correction
Mork29 Started conversation Jun 16, 2002
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
Ancient Posted Jun 19, 2002
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
The Artist Formerly Known as Nerd42 Posted Oct 14, 2002
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.
Nerd42
Correction
Ancient Posted May 11, 2005
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.
Key: Complain about this post
Correction
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."