Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!psuvm!cmh117 From: CMH117@psuvm.psu.edu (Charles Hannum) Newsgroups: comp.lang.c Subject: Re: Arrays of functions - calling them with different number of args. Message-ID: <90066.040556CMH117@psuvm.psu.edu> Date: 7 Mar 90 09:05:56 GMT References: <8553@cbnewsh.ATT.COM> <90065.102500BRL102@psuvm.psu.edu> Distribution: na Organization: Penn State University Lines: 29 In article <90065.102500BRL102@psuvm.psu.edu>, Ben Liblit says: > >In article <8553@cbnewsh.ATT.COM>, ijk@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@psuvm.{bitnet,psu.edu} "No noozzzz izzz netzzzsnoozzzzz..." c9h@psuecl.{bitnet,psu.edu} "Mem'ry, all alone in the moonlight ..."