As the title says, just what exactly are bit flags ?
I can't seem to find a definition or explanation of bit flags on this site or in my reference book. I've finally started to learn my first programming library(SDL) through a book, however, bit flags are constantly mentioned and I don't think I'll be able to progress any further until I find out.
In C/C++, boolean variables consume 1 byte of memory. But all that is really needed is 1 bit: 0 means false, 1 means true. Many times, especially when dealing with graphics, rather than consuming a whole byte of memory for each boolean, several booleans are combined into a single byte of memory, where each boolean uses a different bit in the byte. These are then referred to as bit flags, or bit fields.