ADMICRO

What is the output of the following code?

#include <iostream>
 
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;
}

 

Hãy suy nghĩ và trả lời câu hỏi trước khi xem đáp án

ADSENSE / 1
Câu hỏi này thuộc ngân hàng trắc nghiệm dưới đây, bấm vào Xem chi tiết để làm toàn bài
ZUNIA12
ZUNIA9
AANETWORK