What is more practical, call by value, or call by reference for most computation projects? Thanks
What is more practical, call by value, or call by reference for most computation projects? Thanks
Are you asking whether you should pass arguments by reference, or value?
It all depends on the application, and the type of parameter. A good rule of thumb is:
* If you are passing a parameter which will be changed/set by the function, pass by reference.
* If you are passing a parameter whose size is considerably larger than 4 bytes (the size of the address) pass by reference.
* If the size of the parameter is small, and the parameter does not need modification, pass by value.