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

C++ 基础语法29. + #140

Open
QinglinQAQ opened this issue Dec 20, 2023 · 2 comments
Open

C++ 基础语法29. + #140

QinglinQAQ opened this issue Dec 20, 2023 · 2 comments

Comments

@QinglinQAQ
Copy link

No description provided.

@1031507008
Copy link

1031507008 commented Dec 20, 2023 via email

@QinglinQAQ
Copy link
Author

原文:
A& operator=(const A& a){
num1 = a.num1 + 1;
num2 = a.num2 + 1;
return *this;
};
是不是应该这样:
A& operator=(const A& a) {
this->num1 = a.num1 + 1;
this->num2 = a.num2 + 1;
return *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

2 participants