I'm trying to do some testing with member function pointer. What is wrong with this code? The bigCat.*pcat();
statement doesn't compile.
class cat {
public:
void walk() {
printf("cat is walking
");
}
};
int main(){
cat bigCat;
void (cat::*pcat)();
pcat = &cat::walk;
bigCat.*pcat();
}
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…