Computers and Technology
Computers and Technology, 03.01.2022 20:40, witcol386

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++

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 16:00, natasniebow
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
image
Computers and Technology, 23.06.2019 21:00, shyshy1791
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
image
Computers and Technology, 23.06.2019 23:30, jamalchris9353
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
image
Computers and Technology, 24.06.2019 02:30, journeyhile5
How to apply the fly in effect to objects on a slide
Answers: 1
Do you know the correct answer?
Given the following lines of code: class A

{

public:

A() { cout &...

Questions in other subjects:

Konu
English, 06.10.2021 18:30
Konu
Mathematics, 06.10.2021 18:30
Konu
Mathematics, 06.10.2021 18:30
Konu
Computers and Technology, 06.10.2021 18:30