TIP: Click on subject to list as thread! ANSI
echo: cis.os9.6809.coco
to: james jones/all
from: Joseph Cheek 71431,3466
date: 1992-03-31 20:40:31
subject: c on the coco

#: 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).

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.