Jan 1, 2012 at 9:50pm UTC
I have two structures:
SOInterface and
SOEntity .
SOInterface contains this function pointer:
void (*fpQueryState)(); and
SOEntity contains this method:
void QueryCurrState();
This is my program:
1 2 3 4
SOEntity SINewEntity;
SOInterface SINewInterface;
SINewInterface.fpQueryState = SINewEntity.QueryCurrState;
SINewInterface.fpQueryState();
On the 3
rd line, I get this error:
argument of type 'void (SOEntity::)()' does not match 'void (*)()'
Ideas? Am I missing something?
Wazzak
Last edited on Jan 1, 2012 at 9:50pm UTC
Jan 1, 2012 at 11:50pm UTC
Member pointers are not the same as function pointers, maybe this is your issue?
Jan 2, 2012 at 12:48am UTC
Now that you've said that, I dug a little bit deeper and found this parashift page: http://www.parashift.com/c++-faq-lite/pointers-to-members.html
Thanks for the assistance, LB.
Wazzak
Last edited on Jan 2, 2012 at 1:25am UTC