Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!bnrgate!bnr.ca!aruigrok From: aruigrok@bnr.ca (Adrian C Ruigrok) Newsgroups: comp.sys.mac.programmer Subject: Re: More on MPW C 3.0 question Message-ID: <880@bnrgate.bnr.ca> Date: 20 Feb 90 14:52:03 GMT Sender: news@bnrgate.bnr.ca Organization: Bell-Northern Research Lines: 33 References:<162.25dfe4b3@waikato.ac.nz> <10311@hoptoad.uucp> In article <10311@hoptoad.uucp> tim@hoptoad.uucp (Tim Maroney) writes: > > "Str255 *tempp" makes no sense. You can't have a pointer to an array > in C. The compiler should choke on this, but it doesn't. Instead, > your declarations should go: > > Str255 temps; > StringPtr tempp; This is all very fine and good, but it brings up another question that I never did figure out the answer to. What if you want to read an array in as a resource? Then you need a pointer to a pointer or a pointer to an array. Could not the array pointer live in the master pointer and you just point to it? I don't want to lock it down. I was told this would work for an array of characters: char **charResArray; and you can access it by (charResArray *)[i]? This gets even better. How can you declare a 2 dimensional array that is read in as a resource. It would be really nice to be able to read in large lookup tables from resources instead of staticly declaring them. However, I can't get my brain wrapped around these arrays yet! Why can't I just declare it as above and reference it as (charResArray *)[i][j]; the compiler complains that I cannot index this. I think it is expecting the array element to be a pointer to an array. Any insight in this matter would be helpful! Thanks Adrian