I'm a Java developer.
I'm trying to understand a C/C++ project, and I find in it this :
*.h
file :
typedef void (*MyCallback) (MyHandle handle, void* context, MyResult result, ... );
int MyMethod(MyHandle handle, void* context, MyCallback cb);
*.cpp
file:
int MyMethod(MyHandle handle, void* context, MyCallback cb){
//...
}
And I truly didn't get what it is about...
Can anybody explain to me what is that "typedef void
" for? I'm used only to simple typedef for simple structures... But in this one I can see a scary pointer (sorry pointers phobia for a Java developer...).
Moreover, why did we do that typedef?? I don't see it any pointer on MyCallBack
in MyMethod
function.
I need to understand then the meaning of this code.
Thank you a lot!