From: brettk AT compusmart DOT ab DOT ca (Brett Kosinski) Newsgroups: comp.os.msdos.djgpp Subject: Re: arrays of pointers References: <199710250713 DOT UAA05511 AT fep1-orange DOT clear DOT net DOT nz> <3453BF9C DOT 569ABA25 AT alcyone DOT com> Reply-To: brettk AT compusmart DOT ab DOT ca Message-ID: NNTP-Posting-Host: remote455.compusmart.ab.ca Date: 31 Oct 97 15:55:34 GMT Lines: 27 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Erik Max Francis wrote: >Brett Kosinski wrote: > >> Actually, I believe this is correct. Are you sure you are malloc'ing >> the >> pointers before trying to access them? > >Yes, it's correct. > >> *tiledata[ptrNum][dataNum].dat <-- you have to dereference the >> pointer. > >This is incorrect. . has higher precedence than *, so this is >syntactically wrong. What you meant is > > (*titledata[ptrNum][dataNum]).dat, > >or more appropriately, > > titledata[ptrNum][dataNum]->dat, > >which is what the -> operator is for. I thought I did that wrong... oh well, my C is a little bit rusty... (I have to use Pascal in Comp Sci, so C has been on the backburner for a while now. :) Brett.