In the passl-by-value process, the formal parameters of the called function are processed as local variables of the called function, that is, the memory space is opened in the stack to store the values of the real parameters put in by the main function, thus becoming a copy of the real parameters. The feature of value transfer is that any operation of the form parameter of the called function is performed as a local variable, without affecting the value of the real parameter variable of the main function.
During the pass-by-reference process, the form parameter of the called function opens up the memory space in the stack as a local variable, however, the address of the Real Variable put in by the main function is stored. Any operation of the called function on the form parameter is processed as indirect addressing. That is, the address stored in the stack is used to access the real variable in the main function. Because of this, any operation performed by the called function on the form parameter affects the real parameter variables in the main function.
Value Transfer and reference Transfer