What is the output of the following


What is the output of the following program?

#include

class Container {

public:

int value;

Container( int amount ) { value = amount;

cout << "Value " << value << endl; };

~Container() { cout << " You just killed: " << value << endl; };

};

class ExamQuestion {

public :

Container data;

ExamQuestion(int A) : data(A) { cout << "New Object\n";};

ExamQuestion( const ExamQuestion& X ) : data(X.data.value + 10)

{ cout << "Special\n"; };

};

void TrickyPart(ExamQuestion why){

ExamQuestion PartB = why;

cout << "After PartB\n";

}

int main(){

ExamQuestion Answer(1);

cout << "Call TrickyPart\n";

TrickyPart(Answer);

cout << "end" << endl;

}

 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: What is the output of the following
Reference No:- TGS0646760

Expected delivery within 24 Hours