#: 14742 S10/OS9/6809 (CoCo)
31-Mar-92 20:40:31
Sb: c on the coco
Fm: Joseph Cheek 71431,3466
To: james jones/all
Many thanks to James Jones for his help with my programming problems. It now
works! Here's what I did:
First of all, I declared my functions, as they were in a separate source
file:
int func0(), func1(), func2(), etc...;
and then built my array:
int (*funcarr[])() = {
func0,
func1,
func2,
etc... };
I decided to call dofunc by number, instead of by function address; here is
my (short and simple) dofunc function!
dofunc(funcnum)
/* do the func */
char funcnum;
{
return((*funcarr[funcnum])());
}
Thank you so much for your help, James! I appreciate it very much. It is
cleaner, more manageable, and faster than using switch (as I did previously).
|