.,float sco ):Person(nam,s,a),score(s){};后面为什么只有score(s)就行了?score也不是类型啊class Student:public Person{public:\x09Student(string,char,int,float);\x09void display();private:float score;};Student::Student(string nam,char s

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/19 18:58:48
.,float sco ):Person(nam,s,a),score(s){};后面为什么只有score(s)就行了?score也不是类型啊class Student:public Person{public:\x09Student(string,char,int,float);\x09void display();private:float score;};Student::Student(string nam,char s
xN@_eѤ [7CۦSED1Q?J7„0vJY Re.3қ1j25AEhHѶ D%S[|v:֍nF/Kfxځ`D1zwFh^ƝqA (HL䁻/V@*J[4 UZ4%:- Y P C;]|hPd y=}$~wrr +"7=Mol84Y77觛Dw̜Rƅ0u6i2r窸DžK\ڷMFxX4g?0F8{89hZ/y4~Rv(sd

.,float sco ):Person(nam,s,a),score(s){};后面为什么只有score(s)就行了?score也不是类型啊class Student:public Person{public:\x09Student(string,char,int,float);\x09void display();private:float score;};Student::Student(string nam,char s
.,float sco ):Person(nam,s,a),score(s){};后面为什么只有score(s)就行了?score也不是类型啊
class Student:public Person
{
public:
\x09Student(string,char,int,float);
\x09void display();
private:
float score;
};
Student::Student(string nam,char s,int a,float sco ):Person(nam,s,a),score(s){} //////为什么只有、/////score(s)就行了啊?score不是类名啊!
void Student::display()
{
\x09Person::display();
\x09cout

.,float sco ):Person(nam,s,a),score(s){};后面为什么只有score(s)就行了?score也不是类型啊class Student:public Person{public:\x09Student(string,char,int,float);\x09void display();private:float score;};Student::Student(string nam,char s
这是构造函数初始化参数的一种形式,比在构造函数体内部赋值要好.