Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute CPP Exam - Topic 1 Question 19 Discussion

Posted by Jeanice on May 04, 2022 at 08:54 PM

What happens when you attempt to compile and run the following code? Choose all that apply.

#include

#include

#include

using namespace std;

class A

{

int a;

public:

A(int a) {this?>a = a; c++;}

A(const A & a) {this?>a = a.a; c++;}

~A() { c??;}

static int c;

};

int A::c(0);

int main ()

{

A* t[] = {new A(1), new A(2), new A(3),new A(4), new A(5)};

vectorv1(t, t+10);

dequed1(v1.begin(), v1.end());

d1.clear();

v1.clear();

cout<

return 0;

}

Suggested Answer: B, D

Get Premium CPP Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
8 comments · newest first
LI
Lindy 11 months ago
Yeah, the destructor should be called for each object.
CH
Charolette 12 months ago
I thought it would show 0 since they get cleared.
LA
Laurel 12 months ago
Wait, does the destructor get called for all of them?
LI
Lili 1 year ago
Totally agree, the constructor runs 5 times.
AL
Alpha 1 year ago
There are 5 A objects created.
DE
Denae 1 year ago
Alright, this seems straightforward. The export policy shows that R1 is advertising an aggregate route, so the AS path should be 65540.
JA
Jaime 1 year ago
I want to say it's the security group tag number, but was it specific to ports or users? That's what confuses me.
HY
Hyman 1 year ago
Hmm, I'm a bit unsure about this one. The options seem similar, but I think the key is understanding the difference between information and knowledge. Let me think this through carefully.
0/2000 characters

Save Cancel