|
-
December 30th, 2011, 07:05 PM
#1
Member function pointer to a member function
Trying to create a class that has a member function pointer that points to a member function.
Here is a basic example of what I'm trying to do:
class X
{
public:
X();
short myFunction(void*, DWORD, byte);
short (&X::fptr)(void*, DWORD, byte);
};
X::X()
{
fptr = &X::myFunction;
}
in the main program
X myx;
char *a;
DWORD b;
byte c;
myx.*fptr(a, b, c); -> on compile I get 'fptr': identifier not found
I have tried using typedef in various ways and have had no success. Any help would be awesome!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|