|
-
April 19th, 1999, 02:38 AM
#1
Function pointer - 2
Hi I'am still having problem to write function pointer. Couldsomeone give me the answer why the following code does'nt compile.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
class Test;
typedef void (Test::*FUNCPTR)();
class Test
{
public:
Test() {MyFunc=Testfunction;};
~Test() {} ;
void Testfunction() { printf("It works !!!\n"); };
FUNCPTR MyFunc;
};
int main()
{
Test vTest;
*(vTest.MyFunc)();
return (0);
}
Thanks.
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
|