CI

C++ Certified Professional Programmer

228 Questions

You can start the exam to practice all questions related to this exam.

Question No. 1

"What will happen when you attempt to compile and run the following code?


#include <deque> 
#include <vector> 
#include <iostream> 
using namespace std;

class A

{

int a; public:

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


~A() { c??;}

static int c;

};

int A::c(0); int main ()

{

A t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8 , 9};

vector<A>v1(t, t+10); deque<A>d1(v1.begin(), v1.end()); deque<A> d2;

d2 = d1; cout<<A::c<< endl; return 0;

}

How many objects of type A will be created:

"
Choose the correct option from the given list.
01 / 228

0 Discussions

Trending Exams