Mail Archives: djgpp/1999/01/01/23:41:14
Erik Max Francis wrote:
>
> "Mikko V.I. Parviainen" wrote:
>
> > b->line[y][x]
> >
> > Functions well. However, the eight indirections (?) of b
> > for every cell do add significant overhead, so I tried to
> > use an alias for b->line, but could not define the
> > variable.
>
> What? I see only three here.
>
> > In other words, I am trying to define a variable so that
> > I could say
> >
> > temp[y][x] to access b->line[y][x]
> >
> > but cannot find the right expression for temp.
> >
> > If you could point me to the right declaration (or some
> > other solution), I would be mostly thankful.
>
> Talking generally (I'm not terribly familiar with Allegro), it sounds
> like what you want is a "pointer to a structure member," which is not
> possible in C.
Huh??? This code:
struct foo {
int a;
int b;
} f;
int *g(void) { return &f.a; }
seems to be fine.
But I don't think that's even necessary. The following should work:
unsigned char **temp;
temp = b->line;
> In C++ you have pointers to class members, but you still
> have to reference the class instance when dereferencing them, so that
> won't do you any good.
>
> Define a macro if it's really bothering you.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -