Re: storing related structs





Chris Dollin wrote:

<snip></snip>

Well, you have to be /careful/, then: you can only reliably get
at that enum (IIRC) if it's either the first field in the structure
(A or B) or a member of that first field.

Safer, I would have said, to have it outside the union -- but
it depends on the /full details of the problem you're trying
to solve/, with which we have not been blessed.


I agree. Actually, I decided to err on the side of caution and use the type enum field in struct C (external to the related structs).
.



Relevant Pages

  • Re: storing related structs
    ... Why have you declared an enum here? ... you have to somehow keep track of wheter the union ... contains a struct A or a struct B. ... at that enum if it's either the first field in the structure ...
    (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)
  • Auto validation
    ... I am using ASP with vbscript on IIS. ... I have a page that I am using for order entry. ... When the first field ... (member id) ...
    (microsoft.public.scripting.vbscript)