question about copy constructor

Posted by lego69 on Stack Overflow See other posts from Stack Overflow or by lego69
Published on 2010-06-14T20:57:39Z Indexed on 2010/06/14 21:02 UTC
Read the original article Hit count: 120

Filed under:
|

I have this class:

class A {
private:
 int player;
public:
 A(int initPlayer = 0);
 A(const A&);
 A& operator=(const A&);
 ~A();
 void foo() const;
};

and I have function which contains this row:

 A *pa1 = new A(a2);

can somebody please explain what exactly is going on, when I call A(a2) compiler calls copy constructor or constructor, thanks in advance

© Stack Overflow or respective owner

Related posts about c++

Related posts about programming