adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    class CDummy
    {
        public:
        int isitme (CDummy& param);
    };
    int CDummy::isitme (CDummy& param)
    {
        if (&param == this)
            return true;
        else
            return false;
    }
    int main ()
    {
        CDummy a;
        CDummy *b = &a;
        if (b->isitme(a)) 
        {
            cout << "execute";
        }
        else
        {
            cout<<"not execute";
        }
        return 0;
    }

a.

execute

b.

not execute

c.

none of the mentioned

d.

both execute & not execute

Answer: (a).execute

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?