Câu 18: CPP: C++ Certified Professional Programmer
What happens when you attempt to compile and run the following code?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out v1(t, t+10);vector v2(10);transform(v1.begin(), v1.end(), v2.begin(), bind2nd(ptr_fun (Add),1))…
Nội dung câu hỏi
What happens when you attempt to compile and run the following code?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out v1(t, t+10);vector v2(10);transform(v1.begin(), v1.end(), v2.begin(), bind2nd(ptr_fun (Add),1)); vector ::iterator it = find_if(v2.begin(), v2.end(),bind2nd(equal_to (),10)); cout<<*it<<endl; return 0;}Program outputs:
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. false
- B. true
- C. 10 — đáp án hiện tại
- D. 0
- E. compilation error
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.