(10%) Determine whether the following code is correct or not. If it is
correct, predict its output. If it is incorrect, point out the
mistake(s).
// Operator Overloading (P.446)
#include <iostream>
using std::cout;
using std::endl;
class CData
{
public:
int* pdata;
CData(int v = 0)
{ pdata = new int(v); }
CData Add(CData d)
{ return CData(*pdata - *d.pdata); }
CData operator+(CData d)
{ return Add(d); }
void Print()
{ cout << *pdata << endl; }
};
int main()
{
CData a(5), b(3);
CData c;
c = a + b;
c.Print();
return 0;
}