answersLogoWhite

0


Best Answer

parameter passing :

the value of the variable is passed to the called function,but the passed value cant be changed by the function.

ex:

int main()

{

int a,b;

a=5;

foot(a);

printf("%d",a);

}

void foot(int x)

{

x=7;

}

here the value of a ie.5 is passed to the function foot(),and the value 5 is printed since the value of tat variable cant be changed ...

here the address of the variable is send to the function,the function can change its value.

ex:

int main() {

int a,b;

a=5;

b=7;

foot(&a,&b);

printf("%d%d",a,b);

}

void foot(int *x,int *y)

{

*x=6;

*y=8;

}

here the address of a is assigned to x and address of b to y,so by using this more values can be referenced..here &a means it is pointing to an address,*x means it is an indirection pointer tat points indirectly to the or tat references indirectly the value of a.

hence x references a and y references b.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Differentiate Pass by reference and pass by value parameter passing scheme?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Structures of web addresses?

A URL consists of ten parts: the scheme, subdomain, top-level domain, second-level domain, subdirectory, parameter, port, path, query, and fragment.


Does the poem Trees have the rhyme scheme of aa bb cc?

As reference, see the question: What is an Aa bb cc poem


What is the rhyme scheme of the poems?

The rhyme scheme of a poem refers to the pattern in which the lines rhyme with each other. It is usually denoted using letters to represent the different rhyme sounds. For example, a rhyme scheme of ABAB means that every other line rhymes with each other.


Are the lines in a sonnet are written with twice as many stressed syllables?

No, the lines in a sonnet typically have the same number of stressed syllables as other forms of poetry, such as iambic pentameter. The rhyme scheme and structure of a sonnet are what differentiate it from other forms of poetry.


What has the author Emily J Kogos written?

Emily J. Kogos has written: 'Academic book-selling in Kenya with special reference to the role of the English Language Book Scheme (ELBS)'


What is antyodaya scheme?

aim of antyodya scheme


What is a sentence using the word scheme?

The decorator did not approve of my color scheme. She said that my scheme was unworkable.


How do you use the word scheme in a sentence?

That scheme is really great. Do not invest in fraud Schemes.


When rhyming is organized into patterns and can be labeled aaba it is called?

Rhyme Scheme


What is a double complementary color scheme?

this is a rectangular(tetradic)color scheme,also a square color scheme


What has the author Peter Duncan Walsh written?

Peter Duncan Walsh has written: 'The practical analysis and operation of multi-source water supply systems with particular reference to the Lancashire Conjunctive Use Scheme'


Sentence with the word scheme?

The scheme was very succesful.