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 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
Get step-by-step solutions from verified subject matter experts
