Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Call by Value and Call by Reference within the C and C++ forums, part of the Software Development category; Call by Value and Call by Reference In this tutorial you will learn about C Programming - What is difference between call by value and call by reference in function? ...
|
|||||||
|
|||
|
Call by Value and Call by Reference
Call by Value and Call by Reference
In this tutorial you will learn about C Programming - What is difference between call by value and call by reference in function? The arguments passed to function can be of two types namely 1. Values passedThe first type refers to call by value and the second type refers to call by reference. For instance consider program1 Read More... |
| The Following User Says Thank You to Lokesh M For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Call by Value and Call by Reference
It was useful information about passing arguments to functions. In call by value argument gets passed as variables and in call by reference address gets passed. Does it mean if we use call by reference the execution time would be faster for the function since we the address gets accessed directly. If not why is it so?
|
|
|||
|
Re: Call by Value and Call by Reference
call by value:
fun(5); call by reference fun(&a); definition call by value int fun(int a) { int b; b= a+ 2; return(b); } call by reference int fun(int *a) { b=(*a )+ (*a) return b; } |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|