Arrays of functions - calling them with different number of args.

Charles Hannum CMH117 at psuvm.psu.edu
Wed Mar 7 19:05:56 AEST 1990


In article <90065.102500BRL102 at psuvm.psu.edu>, Ben Liblit <BRL102 at psuvm.psu.edu>
says:
>
>In article <8553 at cbnewsh.ATT.COM>, ijk at cbnewsh.ATT.COM (ihor.j.kinal) says:
>>
>>I've set up an array of 50 functions, to be called with one standard
>>argument, and my function call looks like this [which particular
>>function to be called is determined by the action_ind.
>>
>>                        action_tbl [ action_ind ] ( one_arg )
>>
>>        where the one_arg is a pointer to a particular type.
>>
>>Now, I want to add some functions that will have two arguments.
>
>The best solution I can think of is to stick with a single argument, but make
>one_arg a void pointer.  A particular function will typecast one_arg to a
>pointer to a structure containing the actual parameters to be used.  Make any
>sense?

... or you could use a variable argument list ...


Virtually,
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117 at psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h at psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."



More information about the Comp.lang.c mailing list