Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What do you mean by call by value and call by reference?

Answer Posted / glibwaresoftsolutions

A common topic that often appears in C++ interview questions is the difference between call by value and call by reference.
• Call by Value in C++: In the call-by-value method, function arguments are passed by copying the value of the actual parameter.
• This ensures that the original values remain unchanged since a separate copy of the value is created for the function's parameters.
• Call by Reference in C++: In the call-by-reference method, the memory address (or reference) of the actual parameter is passed to the function.
• This allows direct access to and modification of the original values.
• Both the actual and formal parameters refer to the same memory address, so any changes made to the parameters within the function are directly reflected in the original values outside the function.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of static class data?

1138


Give an example of run-time polymorphism/virtual functions.

968


What is the full form nasa?

1046


How do you flush a buffer in c++?

1066


What can I safely assume about the initial values of variables which are not explicitly initialized?

1015


What are structs in c++?

982


Why cout is used in c++?

985


What are shallow and deep copy?

1061


what are Operators and explain with an example?

1133


Who calls main function?

1061


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

1216


What is the difference between #define debug 0 and #undef debug?

1149


What does it mean to declare a member variable as static?

1017


What is constructor and destructor in c++?

1065


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

1102