home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19846 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!torn!nott!cunews!revcan!balsam!uuisis!tanda!marc
  2. From: marc@tanda.isis.org (Marc Thibault)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: build an array of * to functions
  5. Message-ID: <137825046DN5.61R@tanda.isis.org>
  6. Date: Sat, 23 Jan 93 11:22:08 EST
  7. References: <2514@itexjct.jct.ac.il>
  8. Reply-To: marc@tanda.isis.org
  9. Distribution: na
  10. Organization: Thibault & Friends
  11. Lines: 40
  12.  
  13. In article <2514@itexjct.jct.ac.il> 
  14. (Yoel Gurfinkel) writes: 
  15. > But i don't know how to build an aray of 2 dimesions
  16. >  sign + pointer to his function(with variables).
  17.  
  18.                 thing (*fArray[size])(thing);
  19.  
  20.         - defines an array of "thing function(thing)" pointers. These
  21.         can also be initialized as in:
  22.  
  23.         void (*funcPtrs[])(Cl) = {leaveF, showB, fxor, showM};
  24.  
  25.         where leaveF would be declared as "void leaveF(Cl)".
  26.  
  27.          By extension, it seems that a two-dimensional array could be
  28.          defined as
  29.  
  30.                 thing (*fArray[rows][cols])(thing);
  31.  
  32.          I haven't tried it but it seems the right thing to do.
  33.  
  34.         Cheers,
  35.                Marc
  36.  
  37. ---
  38.  Marc Thibault        |  Automation Architect        |  All we are saying
  39.  marc@tanda.isis.org  |  R.R.1, Oxford Mills,        |  is give global
  40.  CIS:71441,2226       |  Ontario, Canada  K0G 1S0    |  warming a chance.
  41.  NC FreeNet: aa185    |                              |
  42.  
  43. -----BEGIN PGP PUBLIC KEY BLOCK-----
  44. Version: 2.0
  45.  
  46. mQBNAiqxYTkAAAECALfeHYp0yC80s1ScFvJSpj5eSCAO+hihtneFrrn+vuEcSavh
  47. AAUwpIUGyV2N8n+lFTPnnLc42Ms+c8PJUPYKVI8ABRG0I01hcmMgVGhpYmF1bHQg
  48. PG1hcmNAdGFuZGEuaXNpcy5vcmc+
  49. =HLnv
  50. -----END PGP PUBLIC KEY BLOCK-----
  51.  
  52.  
  53.