adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    class Foo
    {
        public:
        Foo(int i = 0){ _i = i;}
        void f()
        {
            cout << "Executed"<<endl;
        }
        private:
        int _i;
    };
    int main()
    {
        Foo *p = 0;
        p -> f();
    }

a.

Executed

b.

Error

c.

Runtime error

d.

None of the mentioned

Answer: (a).Executed

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?