home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22082 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  944 b 

  1. Path: sparky!uunet!portal!cup.portal.com!Aurelius
  2. From: Aurelius@cup.portal.com (Mark Christian Barnes)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: functions as arguments in DEC C
  5. Message-ID: <74480@cup.portal.com>
  6. Date: Wed, 27 Jan 93 22:17:29 PST
  7. Organization: The Portal System (TM)
  8. Distribution: world
  9. References:  <1993Jan23.211019.6955@dxcern.cern.ch>
  10. Lines: 21
  11.  
  12. |Burkhard Burow writes:
  13. |
  14. |void q ( int (*c)() );         /* A. prototype of q*/
  15. |void __q( void ( *a)() )       /* B. function with a function as argument*/
  16. |{
  17. | q( a );            /* C. pass the function parameter on to q.*/
  18. |}
  19.  
  20.  It would help if you at least made your arguments and prototypes
  21. consistant with each other:
  22.  
  23. typedef    void * (*UnknownFunc)(    /* argmuments obey K&R promotion */ );
  24.  
  25. void q( UnknownFunc );        /* prototype of q using new type */
  26.  
  27. void __q( UnknownFunc a )    /* function accepting new type */
  28. {
  29.    q( a );            /* pass argument to q */
  30. }
  31.  
  32.             Regards, Aurelius@cup.portal.com
  33.