www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/17/02:11:05

Date: Thu, 17 Jul 1997 18:12:34 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: Array of Functions
To: Benjamin D Chambers <chambers DOT ben AT juno DOT com>
Cc: djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <33CE6092.1840@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <19970716 DOT 221438 DOT 7831 DOT 0 DOT chambers DOT ben AT juno DOT com>

Benjamin D Chambers wrote:
> Unfortunately, I don't know C++ - does anyone know of a good tutorial on
> the web?

This stuff is both C and C++, but no I don't know of ANY tutorials on
the web (try the C and C++ faq's, they may have some answers).

For this topic:
 *a       pointer
 a[]      array
 a()      function
 *a[]     array of pointer
 *a()     fucntion returns pointer
 a[]{}    array of functions (illegal)
 a()[]    function returning array (illegal)
 (*a)()   pointer to function
 (*a)[]   pointer to array?
 (*a[])() array of pointers to functions

so eg:

int (*(*a[])(char *))(void *);

a is an array of pointers to functions taking `char *' and returning a
pointer to a functions that takes `void *' and returns `int'.

Blah
Bill
-- 
Leave others their otherness.

PS: this is the right-left (or something with a very similar name)
rule.  I can't remember off hand what book it came from (had better
examples too), but I have the photocopies of the section at home.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019