C++ question. Please explain in detail if you can. I want tounderstand it clearly. Thank you very much.
This program outputs 10 lines. What are they? Why?
#include <iostream>
#include <string>
using namespace std;
class Student {
public:
Student() {
cout << “Student(), constructor called.” << endl;
}
explicit Student(string stuName) : stuName(stuName) {
cout << “Student(stuName), constructor called.” <<endl;
}
~Student() {
cout << “~Student(), destructor called.” << endl;
}
string getName() {
return this->stuName;
}
virtual void sayHi() {
cout << “Student: Hi!” << endl;
}
void sayHello() {
cout << “Student: Hello!” << endl;
}
private:
string stuName{ “Student” };
};
class CSStudent : public Student {
public:
CSStudent() {}
explicit CSStudent(string stuName) : Student() {}
void sayHello() {
cout << “CSStudent: Hello!” << endl;
}
};
class CSStudent340 : public CSStudent {
public:
CSStudent340()
PayPal Gateway not configured
PayPal Gateway not configured