2012-02-07 96 views

回答

7

你会初始化C++ 03每隔静态成员对象用同样的方法:

class Foo{ 
private: 
    static double (*my_ptr_fun)(double,double);        
}; 

double bar(double, double); 

double (*Foo::my_ptr_fun)(double,double) = &bar; 

无论你会需要一个静态函数指针。

这叫做initializationinstantiation在C++中意味着不同。