Explain the concept of call by reference, with suitable code in C for each. Give advantage and disadvantage of call by reference
In programming, *Call by Reference* is a method of passing arguments to a function. Instead of passing a copy of the variable (as in call by value), the address (reference) of the variable is passed. This allows the function to modify the actual value of the variable in the caller's scope.
### Concept of Call by Reference
When a function is called using *call by reference*, the function receives the reference (memory address) of the arguments, which means any changes made to the parameter within the function will directly affect the actual argument in the calling function. This is different from *call by value*, where the function only works with a copy of the argument, and modifications within the function do not affect the original variable.
In C, call by reference is implemented using pointers. A pointer is a variable that stores the address of another variable, allowing direct manipulation of the variable's value.
### Call by Reference in ____ ______ _______ ________ __________ _______.
__________ _____ _____ ___ ____ ___ ______.
____ _________ ___ ___ _________ ________ _________ ________ _____ ______ _____.
___ ______ _____ ________ __________ _____ ______ ___.
___ __________ ______ __________ ________ __________ ____.
________ ________ ________ ______ ______.
_________ __________ _______ _______ ________ ______ _________ ___.
_____ _____ __________ _________ ______.
______ _______ _____ ________ __________ ______ __________ ______.
____ _____ _____ _____ ____ _________ _______ ________ _____ ______ _______.
_________ _____ ______ ________ ______ _____ _______ _________ _______.
___ ______ ______ ____ _____ _________ ______.
______ ___ ________ ________ ___ _________ ______ __________ ___ ___.
______ _________ _____ ________ ________ _______.
_________ ____ ______ _____ ______ _______ ___ __________ _________ __________.
___ _____ ___ ____ __________ _______ _____ ____ ___ ________ _______ _____.
_______ ___ ________ ___ ____ __________ _________ __________.
_____ ______ _____ __________ __________ _______ ______ _________ __________.
_____ ______ ______ ___ ______ _____ ________.
_________ _____ ____ __________ _____ __________ ____ _______ ______.
_________ ________ ______ ______ _______ ______ ______ _____ __________.
________ ________ _____ _________ _________ ______ __________ _________ _________ _____.
___ ______ ________ ______ ________ ____ _____ ________ __________.
_____ __________ _______ __________ _________ ___ _____ ______.
________ ____ ________ ______ __________ ____ __________ ____ _____ ____ _________ ________.
______ ___ ____ ___ ___ _______ ____ ___ __________ ______ _________ ____.
__________ ______ ___ ______ __________.
__________ ________ ___ ______ ______ _________ ___ ____ _________ ____.
_______ ______ _________ __________ ___.
____ ________ ____ ________ ____ _______ _____ _________ _____ _____.
_________ ______ ______ _________ ____ _____ ______ ___ ____.
_________ ______ _______ _______ _________ ________ __________ ____ ________ ______.
______ _______ ________ ___ ______ _______ __________ ____.
_______ __________ __________ ________ ___ __________ _________.
____ ___ _____ ________ _______ ___ ________ ______ ____.
______ ______ _________ _______ _________ _________ ______.
_____ ________ _______ _______ ______ ______.
________ _________ ____ __________ ______ ______.
___ _____ ______ _______ _______ ________ ________.
_______ _______ __________ ________ ________ _________ ______ _______ _____ __________ _____.
____ ______ _________ _________ ______.
__________ ________ __________ _________ __________.
____ _______ __________ ______ _________ _______ __________ ___ ______ ______ __________.
___ ______ _____ __________ ___ ____ ____ _______ ____.
___ ____ ____ ___ _______.
____ _______ __________ _____ _____ _______ ___ _____ ________ ____ __________.
_______ ________ _________ ________ ________.
________ ______ _______ _____ __________ __________ ________ __________ __________.
_____ _________ ________ __________ _________ ______ _________.
_________ _______ _____ ____ __________ ________ __________.
____ ______ __________ ___ ___ _________ ________ ____ ________ ________.
____ ___ ____ _________ _________ _________ ______.
______ ________ _________ ___ _______ __________ _________ _____ _______.
_________ _______ _______ __________ _________.
______ ___ _________ ______ _____ _____ ________ ____ _________ _________ __________.
______ _________ ________ _________ ______ ________ ________ __________ ____ ______ ______.
____ ________ ___ ____ _________ _________ __________.
_________ ___ ________ _____ ___.
_________ _________ _______ ________ ________ _________ __________ ________ __________ ___ _______ _________.
_____ ___ ___ ________ ______ ____ ______ _________ _____.
________ ________ ___ ___ __________ _________ _________ ___ ______ ____ ______ ___.
________ __________ ________ ________ _____ _______ _______ ______ ________ ________ ______.
____ ______ ________ _________ ________ __________ __________ _______ ____ ______ _____ __________.
___ __________ _________ ____ ___ _______ _______.
_______ ___ ______ _________ ______ _____ ____ ______ __________ _____.
_____ _________ ____ ________ ___ _____ _____ ____ ______ ___.
________ ____ ___ ____ _____ _______ _____ _____ _______.
___ _________ ____ _______ __________.
__________ ________ ____ _______ ____ ___ ____ _____ _________ __________ ________ __________.
____ _____ ___ ______ _________ ____ _____ ______ ______.
________ _________ _________ ___ ___ __________.
_____ ________ ________ ________ ______ __________ ______ _________ ___ _________ ________.
______ __________ _________ ______ __________.
_______ ______ _____ _________ __________ ______ __________ ____ ______ ______ ________.
________ ________ ____ _____ ______ ________ _________.
______ _________ __________ _______ _______ _____.
______ ________ _________ ______.
Get Full Answer on WhatsApp