In a recursive function in C++, one of its argument is reference type. I just want to know what will happen during the recursive call of the function.
Without reference type, I believe every time the function is called recursively, a new variable will be created in the stack. So with the reference, every time what has been created in stack now is some kind of pointer pointing to the address of the original variable where it is declared,right?
So by using reference in such scenario, I believe sometimes we can save some memory.