www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/17/01:16:34

To: djgpp AT delorie DOT com
Subject: Re: Re: Array of Functions
Message-ID: <19970716.221438.7831.0.chambers.ben@juno.com>
From: chambers DOT ben AT juno DOT com (Benjamin D Chambers)
Date: Thu, 17 Jul 1997 01:13:43 EDT

Two messages here,...
Bill Currie wrote:
>Benjamin D Chambers wrote:
>> and died on me.  Does anyone have thoughts about how to 
>solve this?
>
>Yup. For (eg) int foo(int):
>
>int (*foo[])(int);
>^ return type  ^ parameters
>
>Untested (gcc currently busy) but this should be right.
This worked, thanx!
(Before, I had been using:
int (*foo)[](int);	or
int *(*foo)(int);	or
int (*foo)(int)[];
And none of them worked :)
>-- 
>Leave others their otherness.

and

Mike Legg wrote:
>Hi,
>Its much cleaner to do this using virtual functions in
>c++. The compiler will do all this for you.
>(not much help if you don't know c++ but you did ask for
>thoughts)
>In C don't you do this by declaring an array of void?
>Mike.
Unfortunately, I don't know C++ - does anyone know of a good tutorial on
the web?

- Raw text -


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