|
From: Harry P. <wi...@ma...> - 2004-07-03 18:44:49
|
Hello, All!!!
I need to call function-member of class by its pointer. For example:
//- main.h ----------------------------------
#include <iostream>
#include <stdlib.h>
class A
{
public:
int f (void) { return 5; }
};
//- main.cpp --------------------------------
#include "main.h"
using namespace std;
int main(int argc, char *argv[])
{
A cA;
int ( A::*pFunc ) (void);
pFunc = &A::f;
// cout << ??? How I can call cA.f() using the pointer pFunc?
system("PAUSE");
return 0;
}
|