This is infinite recursion. The class constructor seems to be calling itself over and over again. if you are using gcc, you will see a warning similar to this:
warning: variable 'a' is uninitialized when used within its own
initialization [-Wuninitialized]
A a(a);
this is the same as you call this function:
void assign(int& a){
assign(a);
}
int main(){
int a;
assign(a);
return 0;
}
no compilation error, this is a logical error
source
share