Pointers to functions on Xenix
Larry Jones
scjones at sdrc.UUCP
Sat Sep 9 07:45:57 AEST 1989
In article <1989Sep8.021802.29203 at Octopus.COM>, stever at Octopus.COM (Steve Resnick ) writes:
> my problem is that the Xenix C compiler bitches at using pointers to
> functions. For example, consider the follow fragment...
> (Cmds[idx].fptr)(c,v); /* Here is where I call the function */
>
> This is what the compiler doesn't like. The error message is something like
>
> Term does not evaluate to a function.
The error message says it all -- (Cmds[idx].fptr) is not a
function, it's a POINTER to a function. You need to use
(*Cmds[idx].fptr) for many existing implementations, although
ANSI C allows as few or as many asterisks as you like.
Once again, let's all repeat in unison:
In C, the use of a variable and it's declaration should look the
same.
----
Larry Jones UUCP: uunet!sdrc!scjones
SDRC scjones at SDRC.UU.NET
2000 Eastman Dr. BIX: ltl
Milford, OH 45150-2789 AT&T: (513) 576-2070
"I have plenty of good sense. I just choose to ignore it."
-Calvin
More information about the Comp.lang.c
mailing list