对象指针为NULL,为什么还是可以调用成员函数

B 要理解这个的话。。。成员函数其实可以认为是一个普通的函数,比如 1 2 3 4 class A{ public:     void func(int x) { cout<<"hello, A. x="<<x<<endl; } }; 在编译器看来,大概就长这个样子吧: 1 void A_func(A* this, int x) { cout<<"hello, A. x="<<x<<endl; }
相关文章
相关标签/搜索