Article View: comp.sys.next.programmer
Article #2290Re: Pointers to functions in method definitions
From: Dwight Everhart
Date: Mon, 11 Jan 1993 02:46
Date: Mon, 11 Jan 1993 02:46
20 lines
1300 bytes
1300 bytes
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
Technical Details
Message-ID:
<C0o516.8Aq@biff.gbdata.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!psinntp!sugar!tghost!unkaphaed!biff!biffReferences:
<C0CAtI.KqM@knot.ccs.queensu.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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