CPP use same name for class attribute and constructor attribute

后端 未结 0 912
旧时难觅i
旧时难觅i 2021-01-03 21:50

Say I have a class with a constructor as follows.

// CPP
class Person
{
    int age;
    void Person(int a)
    {
        age = a;
    }
}

Is

相关标签:
回答
  • 消灭零回复
提交回复
热议问题