What will be the output of the following code?

#include <iostream>
using namespace std;

class Zero{};

class One: public Zero{};
class Two: public Zero{};

int main()
    One* pO = new One;
    Two* pT = new Two;

    cout << (typeid(pO) == typeid(pT)) << endl;
    return 0;

Check this question, please. I tried to run this code and all works correct.

2022 Sep 22, 5:27:32 PM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes