[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function pointer
From: |
hns |
Subject: |
Re: function pointer |
Date: |
31 Jul 2006 07:30:17 -0700 |
User-agent: |
G2/0.2 |
> I want to set a function pointer passing it to an object. I think it
> would be something like this
>
> -(int) setPotential: (double)(*potential)(double r, void * par);
>
The correct syntax of Objective-C should be which makes it impossible
to specify function pointers directly:
- (int) setPotential:(TYPE *) potential
i.e. try
typedef double (*FPTR)(double r, void * par);
- (int) setPotential:(FPTR) potential;
-- hns