When making a function call in Linux (or OS X for that matter), can the callee modify the values of the arguments on the stack? I was under the assumption that since the ca
If you pass by value:
call do_it(to_it);
The argument is copied (probably to the begining of the stack but maybe not depending on your compiler) the celled program can mess with this copy as much as it wants but the variable in the clling program will not be changed.
If you pass by reference:
call do_it(&to_it);
Then the address of the variable is passed. Any changes the called variable makes will be to the original variable in the calling program.