Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!pt!andrew.cmu.edu!carm+ From: carm+@andrew.cmu.edu (Rick Chimera) Newsgroups: comp.lang.c Subject: Re: can you 'splain this to me? Message-ID: <8UzX1ay00UsFsGM0P3@andrew.cmu.edu> Date: Fri, 17-Jul-87 10:10:46 EDT Article-I.D.: andrew.8UzX1ay00UsFsGM0P3 Posted: Fri Jul 17 10:10:46 1987 Date-Received: Sat, 18-Jul-87 14:51:29 EDT Organization: Carnegie Mellon University Lines: 25 In-Reply-To: <966@lll-lcc.aRpA> > In an article called "The C Programming Language" by Ritchie, et al, there > is an example given that I can't seem to figure out. The example is supposed > to be a pointer to an array of pointers to functions, each retuning an int > and its declaration is: > int (*(*funnyarray)[])(); Just use the "left-right" rule to figure out uglies like this. You find the C identifier being declared, that's 'funnyarray' in this case. Then you look left. You see a '*'. Ok, result_so_far <- "pointer to". Now you look right. You see (besides the parens which I assume you know how to deal with, they just separate nonobvious or override precedences) the '[]' brackets. So we have result_so_far <- "pointer to array". Now you look left again. You see another '*'. We have now result_so_far <- "pointer to array of pointers to". Look right again. You see the '()' parens (which I hope you can distinguish from precedence parens to know they mean functions....). Now we have result_so_far <- "pointer to array of pointers to functions". You look left again to see the 'int'. Now you have result_so_far <- "pointer to array of pointers to functions returning int". Looking right we see the ';' so you are done. QED. Rick Chimera Arpa: carm+@andrew.cmu.edu UUCP: ...!{seismo, ucbvax, harvard}!andrew.cmu.edu!carm+