类定义中.h
enum { FuncNum = 2 };               //当前支持糊牌种类的数目
void (CClient::*pFunc[FuncNum])();  //糊牌函数指针
在构造函数中
pFunc[0]     = &CClient::Style_1;
pFunc[1]     = &CClient::Style_2;
成员函数动用
  for (int n=0; n<FuncNum; n++)
(this->*pFunc[n])();
     

解决方案 »

  1.   

    typedef returntype (*LPMYFUNCTYPE)(paramtype a, ...);
    LPMYFUNCTYPE      pFunc[XXX]; // Assume you have XXX functions// How to call?
    pFunc[i](1, 2, ...);// That's all.
      

  2.   

    don' scare him/her with member function pointers, :-)#include <iostream>
    using namespace std;typedef void (*MyFunDef)(const char*);void hello(const char *s)
    {
      cout << "hello, " << s << endl;
    }void shakehand(const char* s)
    {
      cout << "let's shake hand, " << s << endl;
    }MyFunDef fArray[] = {hello,shakehand};int main()
    {
      char* name = "myheart8541_cn";
      for (int i=0; i < sizeof (fArray)/sizeof(fArray[0]);i++)
    (*fArray[i])(name);
      return 0;
    }