Re: C question
- From: Colin Paul Gloster <Colin_Paul_Gloster@xxxxxxx>
- Date: 27 Jul 2005 14:55:15 +0200
As already answered by someone else, you have found an
example of bit fields. The reason no field name exists
on line 3 is because it is just padding.
Do not use bit fields in C. From page 150 of the second
edition of Kernighan and Ritchie, "The C Programming
Language", ISBN 0131103628:
"[..]
Almost everything about fields is implementation-dependent.
Whether a field may overlap a word boundary is
implementation-defined. [..]
Fields are assigned left to right on some machines and
right to left on others. [..]"
Use bitwise operators instead of bit fields if you want to use
C, if you would like to use notation like bit fields' then
consider programming in Ada ( news:comp.lang.ada ) and taking
advantage of its representation clauses (please see the bottom
of WWW.AdaIC.org/standards/95lrm/html/RM-13-5-1.html for an
example).
.
- Follow-Ups:
- Re: C question
- From: David T. Ashley
- Re: C question
- From: Grant Edwards
- Re: C question
- References:
- C question
- From: Xarion
- C question
- Prev by Date: Re: Confused with "task" keyword.
- Next by Date: Re: C question
- Previous by thread: Re: C question
- Next by thread: Re: C question
- Index(es):
Relevant Pages
|