Portability question

Paul Schauble Schauble at MIT-MULTICS.ARPA
Tue Nov 5 14:37:42 AEST 1985


Could people please comment on the portability of this structure?  If
it's not, why not and how does one set up a structure where one needs to
access the items both by pointer/subscript in a loop and by individual
name in inline code?

    struct x {something};
    struct x *ip;

    struct
      {
          struct x a;
          struct x b;
          struct x c;
          struct x d;
          struct x e;
      }
          index;

    y = index.a.whatever;
    z = index.c.whatever;

    ip = (struct x *)&index;
    ...
    w = ip[i].whatever;

---------------------------------

Flames accepted...the temperature here hasn`t gone over 90 in aweek
now...

              Paul Schauble
              Schauble at MIT-Multics.ARPA
              ...but really in Phoenix, AZ



More information about the Comp.lang.c mailing list