Question: Private: int perm; std:: string name; Suppose you have a class student with private data members as shown in the box at right. You could

 Private: int perm; std:: string name; Suppose you have a class

Private: int perm; std:: string name; Suppose you have a class student with private data members as shown in the box at right. You could write a constructor like this: Student::Student(int thePerm, std::string theName) {perm = thePerm; name = theName;} However, there is an alternate way to initialize data members in the so called "constructor initialization section" described in Section 10.2 of PS9. Rewrite this constructor so that the body is an empty set of braces, and the code is moved to the so-called "constructor initialization

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!