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, 22.06.2019 04:30
How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topic? one clue is the type of web site it is--the domain name ".org" tells you that this site is run by a nonprofit organization.
Answers: 2
question
Computers and Technology, 22.06.2019 08:30
Active listen eliminates barries to communication true or false
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
You know the right answer?
Given the following lines of code: class A

{

public:

A() { cout &...
Questions
Questions on the website: 13722362