pointers to pointers to functions

Conor P. Cahill cpcahil at virtech.UUCP
Fri Oct 13 11:32:16 AEST 1989


In article <8247 at medusa.cs.purdue.edu>, bouma at cs.purdue.EDU (William J. Bouma) writes:
>          int (**f)();
> 
>     And then I tried mallocing some space for it like this:
> 
>          f = (int (**)()) malloc(n * sizof(*f));
                                       ^^^^^
                                       sizeof(

This  worked fine (without any compiler complaints) on both gcc and pcc under
System V/386 Rel 3.2.

>     ?????? Also, C doesn't care if I call the function:

>         (*f[x])();  or  (f[x])();

The first one is conceptually correct, but most compilers will allow both
of them.  I *think* ANSI requires that both be accepted.

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.lang.c mailing list