what is the differance between pass by reference and pass
by value.

Answer Posted / achal ubbott

When we use 'pass by value' method, acopy of the object is
sent to the called function. So the copy constructor of the
object gets called. But the called function cannot modify
the content of the original object.
But references of an object are like alias. When 'pass by
reference ' is used it is actually using address at the
underlying. This way the called function may modify the
contents of the original object since operations are being
performed over the same object using its address, not on
the copy.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

3973


How do you use a 'Local Block'?

714


How is null defined in c?

646


how we can make 3d venturing graphics on outer interface

3994


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

631






Explain what’s a signal? Explain what do I use signals for?

605


Why is event driven programming or procedural programming, better within specific scenario?

1947


What's the right way to use errno?

615


What are # preprocessor operator in c?

624


Can you mix old-style and new-style function syntax?

656


Can a pointer be static?

609


What is the benefit of using const for declaring constants?

579


Write a program with dynamically allocation of variable.

600


What is #include conio h?

586


In a switch statement, what will happen if a break statement is omitted?

596