Re: structure address = structure first field address ?



Vincent De Groote wrote:
Hello,

Does the C89/c90 language asserts that the address of a structure and
the address of the first field of the structure are the same ?

The standard guarantees that "A pointer to a structure object,
suitably converted, points to its initial member (or if that member is
a bit-field, then to the unit in which it resides), and vice versa.
There may be unnamed
padding within a structure object, but not at its
beginning." (6.7.2.1p13)
.



Relevant Pages

  • Re: Undefined behavior - 2 queries
    ... at compilation time. ... you'll find that no padding may be inserted before the ... first member of a structure. ... Within a structure object, the non-bit-field members and the units ...
    (comp.lang.c)
  • Re: Address of a structure and its first field
    ... C90 is explicit about this. ... Within a structure object, ... initial member (or if that member is a bit-field, ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Re: casting of structs
    ... can you quote the portion of the Standard that allows this? ... which bit-fields reside have addresses that increase in the order in ... A pointer to a structure object, ... points to its initial member (or if that member is a ...
    (comp.lang.c)
  • Re: Preparing linked form for use.
    ... >I have a membership database where new members register on a website ... > Currently I tick the first field and then untick it to have the yes/no ... > when I open the new member record for the first time. ... > if I had code to populate that field the yes/no boxes would be active. ...
    (microsoft.public.access.forms)
  • Preparing linked form for use.
    ... and I download a CSV so that I can work on the data. ... When I have a new member the sub form has no data and the yes.no ... Currently I tick the first field and then untick it to have the yes/no ... if I had code to populate that field the yes/no boxes would be active. ...
    (microsoft.public.access.forms)