Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!usc!apple!sun-barr!newstop!texsun!texbell!attctc!bobc From: bobc@attctc.Dallas.TX.US (Bob Calbridge) Newsgroups: comp.lang.c Subject: Array of pointers (in general) Message-ID: <10468@attctc.Dallas.TX.US> Date: 4 Dec 89 01:35:14 GMT Distribution: na Organization: The Unix(R) Connection, Dallas, Texas Lines: 31 Most of what I learn of C is picked up by reading other people's code. I know specifically that you can define an array of pointers to predefined character strings by the code char *text [] = { "Stuff", "More stuff", "End of text" }; My immediate need requires that I simply establish an array of pointers and also declare the space to which the pointers point. The data area does not need to have an initial content but must be reserved. Is this possible or is it necessary to have a previously defined data area specified to which the pointers are directed? Am I even being clear? Example: I want 10 uninitialized structures defined but I want to reference them through an array of pointers. Rather than give each structure a name and declare the array like struct entry *list [] = { &S1, &S2, &S3, &S4 }; can I avoid having to declare the structures S1, S2, etc. elsewhere in the program? -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- = I know it's petty.......... = - But I have to justify my salary! - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=