Câu 65: CPP: C++ Certified Professional Programmer
Given three files: class.h, class.cpp and main.cpp containing small C++ project, which sentences are TRUE if you attempt to compile and run the program? Assume that the whole compiling environment is properly set.// File: main.cpp#include #include "class.h"using namespace std;int main(){A a;cout class A {T_v;public:A(…
Nội dung câu hỏi
Given three files: class.h, class.cpp and main.cpp containing small C++ project, which sentences are TRUE if you attempt to compile and run the program? Assume that the whole compiling environment is properly set.// File: main.cpp#include #include "class.h"using namespace std;int main(){A a;cout class A {T_v;public:A() {}A(T v);T getV();};#endif//File: class.cpp#include "class.h"template A ::A(T v):_v(v) {}template T A ::getV() { return _v; }
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. program will display: 0
- B. program will not compile
- C. program will display unpredictable number
- D. program willl be not linked — đáp án hiện tại
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.