Our BraindumpStudy offers you the high-quality New CPP Test Dumps Pdf exam dumps and answers, and make you be closer to success. If you are still worried, you can download New CPP Test Dumps Pdf exam dumps' free demo and answers on probation on BraindumpStudy.COM. We promise, when you purchase New CPP Test Dumps Pdf exam dumps and answers, we will also provide one year free renewal service for you.
Exam Name: C++ Certified Professional Programmer
One year free update, No help, Full refund!
New CPP Test Dumps Pdf Total Q&A: 230 Questions and Answers
Last Update: 2017-04-12
CPP New Braindumps Free Detail: New CPP Test Dumps Pdf
BraindumpStudy is the only one able to provide you the best and fastest updating information about C++ Institute certification New CPP Test Dumps Pdf exam. Other websites may also provide information about C++ Institute certification New CPP Test Dumps Pdf exam, but if you compare with each other, you will find that BraindumpStudy provide the most comprehensive and highest quality information. And most of the information of other websites comes mainly from BraindumpStudy.
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. 2 3 4 5 6 7 8 9 10 11
C. 11 10 9 8 7 6 5 4 3 2
D. compilation error
E. 1 2 3 4 5 6 7 8 9 10
Answer: D
CPP Guides
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 outputs: 3 8
B. program will run forever
C. compilation error
D. program outputs: 2 7
E. program outputs: 2 3
Answer: D
CPP Material CPP Engine
没有评论:
发表评论