TechCPP
TechCPP copied to clipboard
勘误
problems/如果A是某一个类的指针,那么在它等于nullptr的情况下能直接调用里面的A对应类里面的public函数吗.md
示例:
`#include
class A { public: void show() { std::cout << "show!" << std::endl; } };
int main() { A* a_ptr; a_ptr->show();
return 0; }` 实际调用的函数签名是A::show(this),相当于this地址未确定,但成员函数实际不需要this地址,这段代码依旧是可以正常执行的。