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