Hi. I need a copy constructor that takes three arguments for class Customer. Please help with the code that produces such a constructor.
This is my code:
I need a copy constructor that takes three arguments for class Customer.
I think you're getting your terminology mixed up. A copy constructor takes exactly 1 argument: the object to copy.
You can have a constructor with 3 arguments, sure, but it won't be a copy constructor:
1 2 3 4 5 6 7 8 9 10
MyClass::MyClass( const MyClass& obj_to_copy )
{
// a copy constructor
}
MyClass::MyClass( int a, int b, int c )
{
// a constructor that takes 3 arguments
// (not a copy constructor)
}