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

Veröffentlicht am: 14 Januar 2015
auf dem Kanal: 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.


Auf dieser Seite können Sie das Online-Video C Programming Language Tutorial 37 Difference between Call by Value and Call by Reference mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Champion Mahipal 14 Januar 2015 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 3,999 Mal angesehen und es wurde von 7 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!