700+ câu trắc nghiệm Ngôn ngữ lập trình C có đáp án - Phần 19

What is the output of the following code? #include using namespace std; class professor { public: professor() { cout << "professor "; }; }; class researcher { public: researcher() { cout << "

25/25

What is the output of the following code? #include using namespace std; class professor { public: professor() { cout << "professor "; }; }; class researcher { public: researcher() { cout << "researcher "; }; }; class teacher : public professor { public: teacher() { cout << "teacher "; }; }; class myprofessor : public teacher, public virtual researcher { public: myprofessor() { cout << "myprofessor "; }; }; int main() { myprofessor obj; system("pause"); return 0; }

professor researcher teacher myprofessor

researcher professor teacher myprofessor

myprofessor teacher researcher professor

myprofessor researcher professor teacher

Giải thích

Chọn đáp án B