C++ question. Please explain in detail if you can please. Ireally want to understand it how you got it. Thank you verymuch.
#What is the output of the program above? Please use @A, @B, @C,@D, and nullptr to represent memory addresses.
class StuName {
public:
StuName() {}
StuName(string name) {
this->name = new string(name);
}
~StuName() {
cout << *name << “: Destructor called.” <<endl;
}
const string* getName() const {
return this->name;
}
private:
string * name{ nullptr };
}
void passByRef(const unique_ptr<StuName>& uPtr_R) {
cout << ” name_uPtr_R: ” << addressof(*uPtr_R) <<endl;
cout << ” getName(): ” << *(uPtr_R->getName())<< endl;
}
void passByMove(const unique_ptr<StuName> uPtr_M) {
cout << ” name_uPtr_M: ” << addressof(*uPtr_M) <<endl;
cout << ” getName(): ” << *(uPtr_M->getName())<<
PayPal Gateway not configured
PayPal Gateway not configured