Examveda

What will be the output of the following C++ code?
#include 
using namespace std;
class CDummy
{
    public:
    int isitme (CDummy& param);
};
int CDummy::isitme (CDummy& param)
{
    if (¶m == 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. error

D. both execute & not execute

Answer: Option A


Join The Discussion

Related Questions on Classes and Objects in C plus plus