how to write a constructor...

Posted by Nima on Stack Overflow See other posts from Stack Overflow or by Nima
Published on 2010-06-02T02:13:47Z Indexed on 2010/06/02 2:23 UTC
Read the original article Hit count: 276

is that correct to write a constructor like this?

class A
{
    A::A(const A& a)
    {
    ....
    }
};

if yes, then is it correct to invoke it like this:

A* other;
...
A* instance = new A(*(other));

if not, what do you suggest?

Thanks

© Stack Overflow or respective owner

Related posts about c++

Related posts about object-oriented-design