Sir, when we “pass by value” , then there is no change in main function. But, when we “pass by address” , then why and how does changes occur in main function?
Doubt in theory part
hello @chandreshmaurya
yeah in pass by value we are actually passing the value only.
so whatever changes we will make it will be on the passed value but not on the value that is there in main function.
but
when we are passing by reference then in that case same variable is passed . so whaterver changes the function is making on that variable.
it is getting reflected in main function.
i would recommed u to read about reference variables in c++ for clarity
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.