question about copy constructor
- by lego69
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