bit-fields
Parsing a bit field parameter, how to "discard" bits in an unsigned long?
First of all, I want to know if this is possible: let\'s say I have an unsigned long which contains some abritrary unsigned shorts, which may or may not be in the number. For example:[详细]
2022-12-15 15:45 分类:问答How do I parse out n-bit elements from a byte addressable array
I have a data stream that is addressable only in 8-bit bytes, I want to parse it out into 6-bit elements and store that into an array.Is there any best known methods to do this?[详细]
2022-12-13 18:00 分类:问答force a bit field read to 32 bits
I am trying to perform a less-than-32bit read over the PCI bus to a VME-bridge chip (Tundra Universe II), which will then go onto the VME bus and picked up by the target.[详细]
2022-12-13 01:51 分类:问答C++ bool array as bitfield?
let\'s say i need to store 8 bools in a struct, but i want to use for them only 1 b开发者_C百科yte together, then i could do something like this:[详细]
2022-12-12 06:04 分类:问答What's the best way to return multiple enum values? (java and C#)
more of original content deleted to make question easier to reference: So I have a House class that has a method House.buy(Person p), causing the person to buy the house. I want to know if its possib[详细]
2022-12-11 13:41 分类:问答What does a colon in a struct declaration mean, such as :1, :7, :16, or :32?
What does the following C++ code mean? unsigned char a : 1; unsigned char b : 7; I guess it creates two char a and b开发者_开发问答, and both of them should be one byte long, but I have no idea wh[详细]
2022-12-09 06:58 分类:问答Bitfield masks in C
Is there a portable way in C to find out the mask for a bit field at compile time? Ideally, I\'d like to be able to atomically clear a field like this:[详细]
2022-12-08 18:55 分类:问答Removing Bit fields in a struct
I have a question. I have a legacy application which used bit fields in a structure. Something like this[详细]
2022-12-08 14:34 分类:问答