booklog
Junior Member level 3
In the below program, i want to know what function f5 is trying to do. What does
return X() mean, since X() is not a object.
class X
{
int i;
public:
X(int ii = 0);
void modify();
};
X::X(int ii)
{
i = ii;
}
void X::modify()
{
i++;
}
X f5()
{
return X();
}
return X() mean, since X() is not a object.
class X
{
int i;
public:
X(int ii = 0);
void modify();
};
X::X(int ii)
{
i = ii;
}
void X::modify()
{
i++;
}
X f5()
{
return X();
}