CertyRush
Đang tải...
C CertyRush
Câu hỏi free preview

Câu 1: CPP: C++ Certified Professional Programmer

Which method added to class B at the marked spot will allow the code below to compile? Choose all possible solutions.#include #include #include using namespace std;class B { int val;public:B(int v):val(v){}int getV() const {return val;}/* Insert Code Here */};ostream & operator struct Out { ostream & out;Out(ostream &…

Nội dung câu hỏi

Which method added to class B at the marked spot will allow the code below to compile? Choose all possible solutions.#include #include #include using namespace std;class B { int val;public:B(int v):val(v){}int getV() const {return val;}/* Insert Code Here */};ostream & operator struct Out { ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out v1(t, t+10); sort(v1.begin(), v1.end(), greater ()); for_each(v1.begin(), v1.end(), Out (cout));cout<<endl; return 0;}

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.

  1. A. bool operator < (const B & v) const { return val<v.val;}
  2. B. bool operator > (const B & v) const { return val<v.val;} — đáp án hiện tại
  3. C. bool operator > (const B & v) const { return val>v.val;} — đáp án hiện tại
  4. D. bool operator == (const B & v) const { return val==v.val;} — đáp án hiện tại
  5. E. operator int () const { return val; }

Cộng đồng

0 bình luận công khai. Tên thành viên được ẩn một phần.

Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.

Câu hỏi liền kề