C++中空指針訪問類方法

先看一段代碼:ios #include<iostream> using namespace std; class A { public: void func(){ cout << "hello" << endl; } }; int main(){ A *p = nullptr; p->func(); return 0; } 一開始看到這個
相關文章
相關標籤/搜索