What is difference between call by reference, call by value and call by pointer
Let me start by saying who taught you C/C++ forgot to tell you call by value and call by pointer is same.
If you know about it good others please stop calling me crazy. Call by pointers is another name for call by value on pointers. Just think about if a language provides you call by value, and pointers to access memory locations and given that you want to implement a function which modifies its arguments you will arrive at same result, just without a fancy name. You will pass address which does call by value to copy of address variable and the changed value in that address is retained, because you are not changing the address. I would just like to pass constant pointer.
Yup I tooĀ realizedĀ it, when I was in my freshman year. It was aĀ ahaĀ moment, and thought late Ritchie make a april fool of us by coining that term.Ā
So the question boils down to call by reference vs call by value.
So we all know. Call by reference will go an extra step in copying the argument value in stack to their original calling functions local address.
So in the linkĀ in the section of "The calle's action before ending" there will be someĀ write-upsĀ to localĀ functionĀ values before an exit.Ā
Hope I helped you in some bits. Feel free to msg me or help me understand if I went some place wrong.