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, 24.06.2019 00:00
Visualizing a game of β€œtag” to remember the meaning of contagious
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
Which of the following terms refers to a collection of different types of software that share the goal of infiltrating a computer and making it do something? a- malware b- virus c- spyware d- trojan horse
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
question
Computers and Technology, 25.06.2019 08:20
The process of representing data in digital form so it can be used by a digital computer is called decimal byterepresentation. - true or false
Answers: 3
You know the right answer?
Given the following lines of code: class A

{

public:

A() { cout &...
Questions
question
Mathematics, 02.10.2019 18:50
question
Mathematics, 02.10.2019 18:50
Questions on the website: 13722363