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 - C++ Certified Professional Programmer Exam Questions

Exam Name: CPP - C++ Certified Professional Programmer
Exam Code: CPP - C++ Certified Professional Programmer
Related Certification(s): C++ Institute C++ Certified Professional Programmer CCP Programmer Certification
Certification Provider: C++ Institute
Actual Exam Duration: 65 Minutes
Number of CPP - C++ Certified Professional Programmer practice questions in our database: 228 (updated: Jul. 25, 2024)
Expected CPP - C++ Certified Professional Programmer Exam Topics, as suggested by C++ Institute :
  • Topic 1: Typical problems when using templates/ Types of sequential containers
  • Topic 2: Classes which provide the input and output capability/ STL Sequential containers
  • Topic 3: Sequential container adapters ?stack, queue and priority queue/ Modifying STL algorithms
  • Topic 4: Dealing with objects as container elements/ STL utilities and functional library
  • Topic 5: List of merging algorithms: merge, includes, min_element, max_element, inplace_merge/ Types of associative containers
  • Topic 6: Putting objects into set and map/ Definition of a modifying algorithm
  • Topic 7: Definition of a non-modifying algorithm/ List of useful functors
  • Topic 8: STL Associative containers/ List of sorting algorithms: random_shuffle, sort, stable_partition, lower_bound, upper_bound
  • Topic 9: Containers compatibility/ Set and multiset ?behavior and API/ map and multimap ?behavior and API
Disscuss C++ Institute CPP - C++ Certified Professional Programmer Topics, Questions or Ask Anything Related

Arlean

14 days ago
Just passed the CPP exam! Memory management was crucial - expect questions on smart pointers and RAII. Understand unique_ptr vs. shared_ptr usage. Thanks Pass4Success for the spot-on practice questions that helped me prep quickly!
upvoted 0 times
...

Margarita

20 days ago
I just passed the CPP exam and I am so relieved! Thanks to Pass4Success practice questions, I was able to tackle the typical problems when using templates and different types of sequential containers. One question that stumped me was about the differences between vector and list in the STL Sequential containers. Can you explain the main distinctions between the two?
upvoted 0 times
...

Free C++ Institute CPP - C++ Certified Professional Programmer Exam Actual Questions

Note: Premium Questions for CPP - C++ Certified Professional Programmer were last updated On Jul. 25, 2024 (see below)

Question #1

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

#include

#include

#include

#include

using namespace std;

class B { int val;

public:

B(int v=0):val(v){}

int getV() const {return val;}

B operator +(const B &b )const { return B(val + b.val);} };

ostream & operator <<(ostream & out, const B & v) { out<

templatestruct Out {

ostream & out;

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

void operator() (const T & val ) { out<

template struct Add : public binary_function {

A operator() (const A & a, const A & b) const { return a+b; }};

int main() {

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

vector v1(t, t+10);

vector v2(10);

transform(v1.begin(), v1.end(), v2.begin(), bind1st(ptr_fun (Add()), 1));

for_each(v2.rbegin(), v2.rend(), Out(cout));cout<

return 0;

}

Program outputs:

Reveal Solution Hide Solution
Correct Answer: E

Question #2

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

#include

#include

#include

using namespace std;

templatestruct Out {

ostream & out;

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

void operator() (const T & val ) { out<

struct Add {

int operator()(int & a, int & b) {

return a+b;

}

};

int main() {

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

vector v1(t, t+10);

vector v2(10);

transform(v1.begin(), v1.end(), v2.begin(), bind1st(1,Add()));

for_each(v2.rbegin(), v2.rend(), Out(cout));cout<

return 0;

}

Program outputs:

Reveal Solution Hide Solution
Correct Answer: E

Question #3

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

#include

#include

#include

#include

using namespace std;

class B { int val;

public:

B(int v=0):val(v){}

int getV() const {return val;}

B operator +(const B &b )const { return B(val + b.val);} };

ostream & operator <<(ostream & out, const B & v) { out<

templatestruct Out {

ostream & out;

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

void operator() (const T & val ) { out<

template struct Add : public binary_function {

A operator() (const A & a, const A & b) const { return a+b; }};

int main() {

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

vector v1(t, t+10);

vector v2(10);

transform(v1.begin(), v1.end(), v2.begin(), bind1st(ptr_fun (Add()), 1));

for_each(v2.rbegin(), v2.rend(), Out(cout));cout<

return 0;

}

Program outputs:

Reveal Solution Hide Solution
Correct Answer: E

Question #4

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

#include

#include

using namespace std;

template

class A {

T_v;

public:

A() {}

A(T v): _v(v){}

T getV() { return _v; }

void add(T & a);

void add(string & a);

};

template

void A::add(T & a) { _v+=a; }

void A::add(string & a) {

_v.insert(0, a);

}

int main()

{

Aa("Hello");

string s(" world!");

a.add(s);

cout << a.getV() <

return 0;

}

Reveal Solution Hide Solution
Correct Answer: B

Question #5

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: true true?

#include

#include

using namespace std;

int main ()

{

bool a,b;

cin>>a>>b;

cout<

return 0;

}

Program will output:

Reveal Solution Hide Solution
Correct Answer: E


Unlock Premium CPP - C++ Certified Professional Programmer Exam Questions with Advanced Practice Test Features:
  • Select Question Types you want
  • Set your Desired Pass Percentage
  • Allocate Time (Hours : Minutes)
  • Create Multiple Practice tests with Limited Questions
  • Customer Support
Get Full Access Now