Skip to content

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

Open
Open

Description

@QinglinQAQ
No description provided.

Activity

  1. 1031507008 commented on Dec 20, 2023

    @1031507008
  2. QinglinQAQ commented on Dec 20, 2023

    @QinglinQAQ
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions