assuming the class is not using dynamic memory
1 2 3 4
|
manager::manager(const manager & m)
{
*this = m;
}
|
Last edited on
That depends on your copy assignment operator.
I am using the default in this program. I am not using dynamic memory allocation.
It is simpler to write
manager( const manager & ) = default;
So does both work? And both do the identical thing? thank you :)
In many cases the copy constructor will be generated automatically so you might not need the line vlad posted.
Here is the rest of the program: http://www.cplusplus.com/forum/general/101142/