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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 17:20, jashaikamatuteowwp1p
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 3
image
Computers and Technology, 22.06.2019 17:00, bnvghnbbb
Match the following. 1. show grouping of word processing tasks that can be performed quick access toolbar 2. shortcut location for commonly used elements scroll bars 3. organized commands used to modify documents ribbon 4. used to align and measure content in a word screen zoom bar 5. vertical and horizontal bars that are used to navigate through a document contextual tabs 6. displays the name of the document in use ruler 7. allows users to enlarge or shrink a visual of a word document title bar
Answers: 2
image
Computers and Technology, 22.06.2019 22:10, Metlife
Asequential circuit contains a register of four flip-flops. initially a binary number n (0000 ≤ n ≤ 1100) is stored in the flip-flops. after a single clock pulse is applied to the circuit, the register should contain n + 0011. in other words, the function of the sequential circuit is to add 3 to the contents of a 4-bit register. design and implement this circuit using j-k flip-flops.
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, rah45
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
You know the right answer?
Given the following lines of code: class A

{

public:

A() { cout &...

Questions in other subjects: