I’ve a pointer function in a class that is defined outside the class and used as a callback.
The class goes like this
class A
{
void CreateGrid(OWindow *win,int x,int y);
Otkobject *GetIcon(void *data,Otkobject *obj,int x)
}
I’ve defined the GetIcon function like this
Otkobject *A::GetIcon(oid *data,Otkobject *obj,int x){
//statements
}
For this I’m getting errors.
Then I tried
Otkobject A::*GetIcon(void *data,Otkobject *obj,int x){
//statements
}
I’m getting function name and use callback. How to use this function pointer?
That’s a function returning a pointer, not a function pointer. The error might be the missing semicolon after the class declaration: