在下面的代碼我收到錯誤:數組指針的成員函數:使其工作
a value of type (double*)(const double& arg) const cannot be assigned to an entity of type pt2calculateA
如何使工作有什麼建議?
class myClass {
private:
typedef double (*pt2calculateA)(double);
pt2calculateA calculateA[2];
public:
myClass() {
calculateA[0] = &calculateA1; //->error
calculateA[1] = &calculateA2; //->error
}
double calculateA1(const double& arg) const {
...
}
double calculateA2(const double& arg) const {
...
}
}
的伎倆感謝那確實! – niels