这简言之,我试图做的事情,我只想混淆右yn。
我希望我能这样做:
struct myStruct
{
functionPointer myPointer;
}
Then I have another function somewhere else that passes a function to a function and returns an instance of my struct. Here s what it does:
struct myStruct myFunction(int (*foo) (void *))
{
myStruct c;
c.myPointer = foo;
return c;
}
我如何使这项工作真正发挥作用? • 正确yn子:
- Declaring a function pointer in my struct (obviously
functionPointer myPointer;
is incorrect) - Assigning a function s address to that function pointer (pretty sure
c.myPointer = foo
is incorrect)?