adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    class class0 
    {
        public:
        virtual ~class0(){}
        protected:
        char p;
        public:
        char getChar();
    };
    class class1 : public class0 
    {
        public:
        void printChar();
    };
    void class1::printChar()
    {
        cout  << "True" << endl;
    }
    int main() 
    {
        class1 c;
        c.printChar();
        return 1;
    }

a.

True

b.

error

c.

no output

d.

runtime error

Answer: (a).True

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?