c++中指向对象的指针为NULL时可以调用对象成员函数吗

问题貌似有点奇怪,指针都为NULL了怎么还可使用?但其实不是的,可以看以下代码: #include <iostream> using namespace std; class A { public: void showSth(); }; int main() { A *a1 = NULL; a1->showSth(); s
相关文章
相关标签/搜索