Can someone tell me why would the compiler give an error for this.
class A
{
private:
int data;
public:
A();
A(A& a) { this->data = a.data; }
};
void main()
{
A a();
A b(a);
}
The error I get is this.
error C2664: 'A::A(A &)' : cannot convert parameter 1 from
'A (__cdecl *)(void)' to 'A &'