Mail Archives: djgpp/1996/09/12/02:50:04
On 11 Sep 1996, Jeff wrote:
> I wish to create a variable, such that a function (with parameters)
> can be assigned to it.
>
> For example, in TurboP7.0:
> type
> ProcPTRType=procedure(x,y : integer);
/* Declare `procedure' to be a pointer to a function which gets
two integers and returns nothing. */
void (*procedure)(int, int);
/* Use it. */
procedure = my_proc;
/* Call it. */
(*my_proc)(x, y);
Actually, you may say just "my_proc(x, y)", but some compilers out there
didn't hear about ANSI C standard which allows this (DJGPP *does* know
about this).
- Raw text -