home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / programm / 8063 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  1.2 KB

  1. Path: sparky!uunet!psinntp!sugar!tghost!unkaphaed!biff!biff
  2. From: biff@biff.gbdata.com (Dwight Everhart)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: Pointers to functions in method definitions
  5. Message-ID: <C0o516.8Aq@biff.gbdata.com>
  6. Date: Mon, 11 Jan 1993 02:46:17 GMT
  7. References: <C0CAtI.KqM@knot.ccs.queensu.ca>
  8. Sender: biff@biff.gbdata.com (Dwight Everhart)
  9. Lines: 20
  10.  
  11. In article <C0CAtI.KqM@knot.ccs.queensu.ca> alastair@hecate.phy.queensu.ca  
  12. (A.B. McLean) writes:
  13. > I want to write a method that will accept a pointer to a C function.
  14. [...]
  15. > In the interface file I would expect (Kernigham amd Ritchie section 5.11)
  16. > the method definition to look like 
  17. > - methodName:void(*gaussian)(float, float*, float*);
  18.  
  19. In Objective-C method declarations, all types must be given in parenthesis,  
  20. using the C type-cast syntax.  Also, the name of the argument is given after  
  21. its type.  So what you want is:
  22.  
  23. - methodName:(void(*)(float, float*, float*))gaussian;
  24.  
  25. --
  26. Dwight Everhart          "Technology turned out to be less important than
  27. Houston, Texas            sales and distribution methods ... we consistently
  28. biff@biff.gbdata.com      outsold people who had better technology."
  29. NeXTMail and MIME OK      -- Thomas J. Watson Jr., on the success of IBM
  30.