what is the difference between call by value and call by
reference?
Answer Posted / mahesh
call by value
int fun(int a,int b);
int fun(int p,int q)
{
temp=p;
p=q;
q=temp;
}
call by reference
int fun(int &a,int &b);
int fun(int *a,int *b)
{
temp=*a;
*a=*b;
*b=temp;
}
call by value is with values n call by ref with adresses n
pointers...
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is pointer and structure in c?
praagnovation
What does the message "automatic aggregate intialization is an ansi feature" mean?
How can you return multiple values from a function?
Can a pointer be null?
Which of these functions is safer to use : fgets(), gets()? Why?
Why clrscr is used after variable declaration?
What is the general form of function in c?
What is an lvalue?
What is sizeof c?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
What is function what are the types of function?
Write a program to check prime number in c programming?
What is structure packing in c?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25