by reference in C++
- by lego69
I have this snippet of the code
Stack& Stack:: operator=(const Stack& stack){
if(this == &stack){
return *this
}
}
here I define operator = but I can't understand, if I receive by reference stack why it should be & in this == &stack and not this == stack and why we return * in return *this and not this thanks in advance for any help