No, and i'd advise against using them even if they were there, but you can
create a structure\class that works like one internally with a little work.
This would be of use only if you need to produce in memory values perhaps to
send to legacy platform code or writing to files that expect bit fields. In
any other condition, just use a normal class and don't worry about space.
Basically, you would encapsulate a BitVector32 or BitArray and provide
boolean & int properties that set bits. You will have to worry about any
possible endian issues, etc, but that shouldn't be much of a problem. This
should allow you to create structures that have the memory equivilent of a
bit vector (marshalling should deal with just the internal BitVector & not
the various properties), or classes that expose a BitVector32 that can be
written to a file containing the proper data format.
Some caevets however, are that bitvector based structures that require ints
will either require you to figure out what bits need be set yourself, or
possibly a custom marshaller that will ignore the Section objects and any
other data you might need to keep track of location.
You will also have to explicitly lay out the BitVector32 fields location if
more than one exists.
I am assuming BitVector32 marshals properly however, it might not, and i
don't really have anything to test with, ;).
"Sagaert Johan" <RE*******************@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP09.phx.gbl...
does c# provide bitfields in structs ??
can't find any hint in msdn
Johan