Home > Back-end >  This problem didn't understand what you mean, in particular, the role of s1 go? Strives for the
This problem didn't understand what you mean, in particular, the role of s1 go? Strives for the

Time:04-24


Build a Student class Student, containing a string name, integer members age and double score, containing the three default constructor argument object initialization students (xiaoming, 18,88.65), a member function print without formal parameters, need to use this pointer to display the contents of the object data members, to code program statement two objects s1, s2, including s2 initialized using the default parameters, and show the students the value of the object data members,

CodePudding user response:

S1 is let you provide parameters, s2 is initialized using the default parameters

CodePudding user response:

Class types, the constructor with the default,
Declare s1, s2 two variables, explicit initialization, s1 s2 default constructor initializes,

CodePudding user response:

The
reference 1/f, the blue sky white clouds ─=?Σ (((つ?? Omega?? ) つ response:
s1 is to allow yourself to provide parameters, s2 is to use the default parameters to initialize

Well, I see, thank you

CodePudding user response:

refer to the second floor zjq9931 response:
class type, a constructor with default values,
Declare s1, s2 two variables, explicit initialization, s1 s2 default constructor initializes,

Well, I see, thank you
  • Related