Technically, C++ cannot allocate anything smaller than a char which generally 1 byte (but doesn''t have to be!)
Bitfields are really just a shorthand way of doing bit operations on a larger amount of data. As someone else pointed out, they are really only useful if you need lots of them and want to save some space.
1 bit BOOL
Thnx to: SilverMace && Anonymous
That explains it pretty good -- I think I can reduce my boolean values a ton by using integer flags -- this way I can just put one int value in my classes and AND the flags together to get the boolean settings - that should create significant savings.
The classes themselves aren''t that consuming space or time wise but if you have a 1000 or more instances of them even the tiny flaws showup big.
That explains it pretty good -- I think I can reduce my boolean values a ton by using integer flags -- this way I can just put one int value in my classes and AND the flags together to get the boolean settings - that should create significant savings.
The classes themselves aren''t that consuming space or time wise but if you have a 1000 or more instances of them even the tiny flaws showup big.
quote:Original post by silvermace
comments:
Programmer Four - try tellling him WHY (see the title "for BEGINNERS")
We can''t all be all right all the time. For instance, you have three l''s in "telling"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement