>thinking using an integer in place of a boolean and magically expecting the computer to semantically know what you mean is "better"
fuck off with your retarded type castings
that's what people start from to reach the point of complaining why their FrameBuffer object isn't automatically casted to a fucking vector array.
Literally fuck off.
hmm, lets see.
The while loops keeps executing what is inside the loop WHILE the expression in brackets after the while keyword evaluates to true (I.E. 1).
Figure the rest out yourself you fucking idiot.
Incase you didn't notice, a boolean is LITERALLY an integer.
It just (theoretically) has a range of 0 to 1, instead of say 0 to 2^64-1.
In reality, booleans are implemented as either a byte or word.
Ain't that some shit: the preque
This was the first thing I tried
So how does your oh so great compiler do it huh?
The only compilers i use are GCC and Clang.
It's not like you can address single bits like you can bytes, so your compiler must be doing some shitty bit hacking that only works well if you have 8 or more booleans, in which case, your compiler is utter garbage.
What if you needed to pass a pointer to individual boolean values huh? what's your compiler gonna do then? you can't rely on your bit hacks anymore.
To make it easy to detect errors where you put values of one type where you really meant to put values of another type. Duh.
(Yeah, I know this entire thread is a troll thread by some idiot who cannot into programming, but dammit, I'm bored.)
It's so aggravating when you something is done in retarded way because of these reasons.
The end result is language like go where you can't do anything and everything is so verbose you lose all the readability.
Yes, those are generally bitfields, that is exactly what i was talking about in my post you idiot, you think I don't know about packing and bitfields?
But as i said, that's a shitty way to do it, seriously.
It's better performance wise to store booleans in the machines native word size.
Having to do fucking bit operations to retrieve and store a value is slow and unacceptable.
Atleast Ada seems to have this as an optional attribute.
Any compiler that forces this is utter garbage though.
A bitfield is only acceptable in large arrays so that the increased cache locality outweighs the bitwise ops penalty.
I expect a major use of it is in embedded programming, where memory space may be at a premium. But the original point was that booleans can and are implemented in other ways than bytes/words.