Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!tektronix!ogcvax!omsvax!hplabs!sri-unix!edhall@rand-unix From: edhall%rand-unix@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Re: C syntax Message-ID: <4358@sri-arpa.UUCP> Date: Fri, 19-Aug-83 03:01:00 EDT Article-I.D.: sri-arpa.4358 Posted: Fri Aug 19 03:01:00 1983 Date-Received: Sun, 21-Aug-83 02:21:51 EDT Lines: 34 Try: static void (*p[N])(); In general, remember that modifiers to a given type (that is, (), *, and []) are parsed right-to-left, successively modifying the base type of the item. Parentheses can change this order. Thus, the above declaration parses: [N] Array of N * Pointers to () Functions returning void type `void', static storage class `static'. Another toughie would be an array of pointers to functions returning strings: char *(p[N])(); With a bit of practice, though, creating data types in C is about as simple as any other language. Some complain that C is `backwards' from languages like PASCAL. This is because the C declaration was designed to be an example of the use of the object declared; thus, using the second declaration for `p', above, the value of `x' in: x = *(p[n])(); is of type `char'. This `declaration by example' is more of a feature than a obstacle. -Ed Hall Rand Corporation