开发者

Not sure of the name.. (bit field)

I'm not sure what the name of this is called, so I had no idea what to call it.

it's when people use a number to type something, but it's somewhat binary based: 1, 2, 4, 8, 16, 32, etc

for example: 1 = apples, 2 = oranges, 4 = bananas then 3 = apples and oranges, 7 = apples, oranges and bananas.

What is this 开发者_Go百科called?


There are many different terms, but I would call that a bit field. If you're using Java there is a class for this called BitSet.

I've also heard it called bit flags.


Bit fields aka Bit flags?

http://en.wikipedia.org/wiki/Bit_field


I think it is (or similar to) bit array. So each bit stores the state of something. In this case whether this fruit is available or not.


That is called a bit flag, or bit field.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜