Skip to content

Update Pointer-to-Class-Members.md #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Chapter 3/Pointer-to-Class-Members.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Notice that static member variables belong to the class instead of objects. So i
int main() {
int *p = &Test::mb;
*p = 30;
cout << t->Test::mb << endl; // 30
cout << Test::mb << endl; // 30
return 0;
}
```
Expand Down Expand Up @@ -125,4 +125,4 @@ void bar() {

The underlying principle is complicated, including implicit type conversion and polymorphism of member functions. Notice that C++ is a language with long history, and there are many historical issues. We don't have to, and can not understand all of them. In the above case, we only need to remember that *&* with function name is always a correct way in using function pointers.

> For more explanations, please refer to C++ standard n3376 - 4.3 - 1 and n3337 - 5.3.1 - 4.
> For more explanations, please refer to C++ standard n3376 - 4.3 - 1 and n3337 - 5.3.1 - 4.