C Programming Language Tutorial 37 Difference between Call by Value and Call by Reference

Publié le: 14 janvier 2015
sur la chaîne: Champion Mahipal
3,999
7

This video is made to learn about Difference between Call by Value and Call by Reference in C Programming Language.

This is made by Swap function.

Call by Value : If we call a function in C by passing values of variables as the parameters/arguments to the function then such type of function call is known as Call by value.
Call by Reference : We know that whatever variable we are using in our program, ultimately it is getting stored somewhere in memory. So instead of passing values of variables as parameters to the function, if we pass address of those variables and somehow able to access data contained inside those addresses then we will be able to call functions.
Interestingly, concepts of Pointers provide us the advantage of manipulating addresses.So calling a function by passing addresses of variables as the parameters to the function is known as Call by Reference.

Arguments passed to the function during function call are known as actual arguments and the arguments we use during a function definition are known as formal arguments. For a function call to be valid the type, order and number of actual and formal arguments must always be same.

During call by value method the ‘value’ of each of the actual arguments in the calling function is copied into corresponding formal arguments of the called function. In this method, the changes made to the formal arguments in the called function have no effect on the values of actual arguments in the calling function.


Sur cette page du site, vous pouvez voir la vidéo en ligne C Programming Language Tutorial 37 Difference between Call by Value and Call by Reference durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Champion Mahipal 14 janvier 2015, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,999 fois et il a aimé 7 téléspectateurs. Bon visionnage!