Every person in the IT industry has his own dream: to pass CPP Reliable Test Passing Score certification exam, or a promotion, a raise and so on in the IT career. The dream of BraindumpStudy is to help you achieve CPP Reliable Test Passing Score exam certification. After you purchase our CPP Reliable Test Passing Score exam dumps training materials, we will provide one year free renewal service. If you fail CPP Reliable Test Passing Score certification exam, we can guarantee you that we will give you a full refund.
Exam Name: C++ Certified Professional Programmer
One year free update, No help, Full refund!
CPP Reliable Test Passing Score Total Q&A: 230 Questions and Answers
Last Update: 2017-03-16
New CPP Practice Test Fee Detail: CPP Reliable Test Passing Score
Our C++ Institute dumps files contain the latest CPP Reliable Test Passing Score practice questions with detailed answers and explanations, which written by our professional trainers and experts. And we check the updating of CPP Reliable Test Passing Score exam pdf everyday to make sure the accuracy of our questions. There are demo of CPP Reliable Test Passing Score free vce for you download in our exam page. One week preparation prior to attend exam is highly recommended.
CPP Free Demo Download: http://www.braindumpstudy.com/CPP_braindumps.html
NO.1 What happens when you attempt to compile and run the following code?
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
template<class T>struct Out {
ostream & out;
Out(ostream & o): out(o){}
void operator() (const T & val ) { out<<val<<" "; } };
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<int> v1(t, t+10);
vector<int> v2(10);
transform(v1.begin(), v1.end(), v2.begin(), bind1st(1,Add()));
for_each(v2.rbegin(), v2.rend(), Out<int>(cout));cout<<endl;
return 0;
}
Program outputs:
A. 10 9 8 7 6 5 4 3 2 1
B. 11 10 9 8 7 6 5 4 3 2
C. 1 2 3 4 5 6 7 8 9 10
D. 2 3 4 5 6 7 8 9 10 11
E. compilation error
Answer: E
CPP Resource
NO.2 What happens when you attempt to compile and run the following code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
class A {
int a;
public:
A(int a) : a(a) {}
int getA() const { return a; } void setA(int a) { this?>a = a; }
bool operator==(const A & b) const { return a == b.a; }
};
bool compare(const A & a, const A & b) { return a == b; }
int main () {
int t[] = {1,2,3,3,5,1,2,4,4,5};
vector<A> v (t,t+10);
vector<A>::iterator it = v.begin();
while ( (it = adjacent_find (it, v.end(), compare)) != v.end()) {
cout<<it?v.begin()<<" ";it++;
}
cout<< endl;
return 0;
A. program will run forever
B. compilation error
C. program outputs: 2 7
D. program outputs: 3 8
E. program outputs: 2 3
Answer: C
CPP Objectives
没有评论:
发表评论