Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

勘误 #60

Open
shiyiyuedeyu opened this issue May 7, 2024 · 0 comments
Open

勘误 #60

shiyiyuedeyu opened this issue May 7, 2024 · 0 comments

Comments

@shiyiyuedeyu
Copy link

shiyiyuedeyu commented May 7, 2024

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地址,这段代码依旧是可以正常执行的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant