Sender: nate AT cartsys DOT com Message-ID: <368DA18C.B83634A4@cartsys.com> Date: Fri, 01 Jan 1999 20:33:17 -0800 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.35 i486) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Allegro, pointers : how do I get line from BITMAP? References: <368CAA68 DOT 5644E9EA AT alcyone DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com 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