Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
At work we have a table hockey game with Sweden vs. Finland. I usually play Finland, because if I lose I can still be happy that Sweden wins.
-
Isn't it hilarious that booleans use up 8bits in RAM? At least we learned it in class
-
@Lahsen2016 I knew that, but it's still hilarious isn't it? High technology but still such basic issues
-
@SteffTek it's much more complicated than that. It depends on the language, hardware, and I'm sure other things
-
I think a boolean takes 8Bits of memory, because you can only adress Bytes at your RAM.
The Problem ist the accessing by a variable, because a pointer to RAM only points to the byte, not the specific bit.
Otherwise you can use a bit vector, which is a series of 0s and 1s and contains 8 booleans per Byte -
@realLifeMock like I said it depends on the language, and the software. What you are saying is totally true for some platforms, and very wrong on just as many different platforms. There are platforms where a Boolean is a bit, or at least there could be.
Also it could be larger too (by C++ definition). -
@Lahsen2016 @SteffTek that's because a byte is the smallest amount of addressable memory. You could work around that with bitwise operations or bitfields, but that's really not worth it
And in some languages (namely C) a bool isn't even a single byte, it's being represented by an int
Oh yeah!
joke/meme
quincy-yo