Summer Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: v4s65

CPP Exam Dumps - C++ Certified Professional Programmer

Searching for workable clues to ace the C++ Institute CPP Exam? You’re on the right place! ExamCert has realistic, trusted and authentic exam prep tools to help you achieve your desired credential. ExamCert’s CPP PDF Study Guide, Testing Engine and Exam Dumps follow a reliable exam preparation strategy, providing you the most relevant and updated study material that is crafted in an easy to learn format of questions and answers. ExamCert’s study tools aim at simplifying all complex and confusing concepts of the exam and introduce you to the real exam scenario and practice it with the help of its testing engine and real exam dumps

Go to page:
Question # 33

What happens when you attempt to compile and run the following code?

#include

#include

int main ()

{

int t[]={1,2,3,4,5};

std::vectorv1(t,t+5);

std::vectorv2(v1);

v1.resize(10);

v2.reserve(10);

std::vector::iterator i = v1.begin();int ii = 0;

while (i != v1.end()) { std::cout<<i[ii]<<" ";ii??;i++; }

i = v2.begin();ii=0;

while (i != v2.end()) { std::cout<<i[ii]<<" ";ii??;i++; }

return 0;

}

A.

program outputs 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B.

compilation error

C.

program outputs 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5

D.

program outputs 1 2 3 4 5 0 0 0 0 0 1 2 3 4 5 0 0 0 0 0

Full Access
Question # 34

What happens when you attempt to compile and run the following code?

#include

#include

#include <algorithm>

using namespace std;

templatestruct Out {

ostream & out;

Out(ostream & o): out(o){}

void operator() (const T & val ) { out<<val<<" "; } };

int main() {

int t1[]={3,2,4,1,5};

int t2[]={5,6,8,2,1};

vector v1(10);

sort(t1, t1+5);

sort(t2, t2+5);

set_difference(t1,t1+5,t2,t2+5,v1.begin());

for_each(v1.begin(), v1.end(), Out(cout));cout<<endl;

return 0;

}

Program outputs:

A.

1 2 3 4 5 6 8 0 0 0

B.

3 4 0 0 0 0 0 0 0 0

C.

6 8 0 0 0 0 0 0 0 0

D.

compilation error

E.

1 2 5 0 0 0 0 0 0 0

Full Access
Go to page: