BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute Exam CPP Topic 1 Question 19 Discussion

Actual exam question for C++ Institute's CPP exam
Question #: 19
Topic #: 1
[All CPP Questions]

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;

}

Show Suggested Answer Hide Answer
Suggested Answer: B, D

Contribute your Thoughts:

Currently there are no comments in this discussion, be the first to comment!


Save Cancel