1

If a class has a constructor with the arguments as defined below

class myclass
{
    public:
        myclass(int a, int b)
        {
            cout << a << b << endl;
        }
};

can anybody please let me know the differences between the 2 forms of object instantiation as mentioned below.

myclass ob(2, 3);
myclass ob = myclass(2, 3);
kadina
  • 4,512
  • 3
  • 37
  • 72

0 Answers0