subject

Given the following lines of code: class A

{

public:

A() { cout << "A constructor "; }

virtual ~A() { cout << "A destructor " << endl; }

};

class B : public A

{

public:

B() { cout << "B constructor " << endl; }

~B() { cout << "B destructor " << endl; }

};

void main()

{

A* a2 = new B;

delete a2;

}

What is expected to be printed after the function execution? Explain.

a. A constructor B constructor B destructor A destructor
b. A constructor A destructor
c. B constructor A constructor A destructor B destructor
d. None.

c++

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Can you make money in why are you guys so
Answers: 1
question
Computers and Technology, 22.06.2019 00:30
Jenny wants to look at row 345 and compare it to row 17. what can she do if she wanted to easily adjust to see both at once?
Answers: 3
question
Computers and Technology, 22.06.2019 21:00
Describir textbook icon_person mira los dibujos y describe lo que está pasando. usa los verbos de la lista.
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
You know the right answer?
Given the following lines of code: class A

{

public:

A() { cout &...
Questions
question
Chemistry, 06.11.2020 16:40
question
Health, 06.11.2020 16:40
question
Social Studies, 06.11.2020 16:40
question
Mathematics, 06.11.2020 16:40
Questions on the website: 13722367