No products in the cart.

What is diffrence between call by …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

What is diffrence between call by value and call by referance
  • 1 answers

Gaurav Seth 5 years, 10 months ago

<th>BASIS FOR COMPARISON</th> <th>CALL_BY_VALUE</th> <th>CALL BY REFERENCE</th>
Basic
 
A copy of the variable is passed. A variable itself is passed.
Effect Change in a copy of variable doesn't modify the original value of variable out side the function. Change in the variable affect the value of variable outside the function also.
Calling Parameters function_name(variable_name1, variable_name2, . . . .); function_name(&variable_name1, &variable_name2, . . . .);
//in case of object
object.func_name( object);
Receiving Parameters type function_name(type variable_name1, type variable_name2, . . . .)
{ . . }
type function_name( type *variable_name1, type *variable_name2, . . . .){ . . }
//in case of object
type function_name(class_type object_name)
{ . . }
Default calling primitive type are passed using "call by value". objects are implicitly passed using "call by reference".
http://mycbseguide.com/examin8/

Related Questions

Write a program for swapping two numbers?
  • 0 answers
Write a program for swapping two numbers
  • 1 answers
Define packages
  • 0 answers
What is alu
  • 1 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App