List out differences between pass by reference and pass by valuePass by value always invokes / calls the function or returns a value that is based on the value. This value is passed as a constant or a variable with value.
Pass by reference always invokes / calls the function by passing the address or a pointer to a memory location which contains the value. The memory location / pointer is populated with a value, so the function could look at the value through that location. The function can update the value available in the memory location by referencing the pointer.
A string in C language is passed by reference.
|